Skip to content

Commit 5ea7377

Browse files
committed
docs(readme): add severity-dependent display section (#182)
1 parent 6807629 commit 5ea7377

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,29 @@ require("tiny-inline-diagnostic").setup({
8080

8181
</details>
8282

83+
### Severity-dependent Display
84+
85+
Always show errors on every line; show warnings, info and hints only on the cursor line.
86+
87+
<details>
88+
<summary>Configuration</summary>
89+
90+
```lua
91+
require("tiny-inline-diagnostic").setup({
92+
options = {
93+
multilines = {
94+
enabled = true,
95+
always_show = true,
96+
severity = { vim.diagnostic.severity.ERROR },
97+
},
98+
},
99+
})
100+
```
101+
102+
Severities listed in `multilines.severity` stay visible on all lines; all other severities only appear on the cursor line.
103+
104+
</details>
105+
83106
### Overflow Handling (by default)
84107
![tiny_inline_2-ezgif com-speed](https://github.com/user-attachments/assets/19da9737-7335-4a53-b364-ac5c12c663b2)
85108

@@ -195,7 +218,10 @@ require("tiny-inline-diagnostic").setup({
195218
always_show = false, -- Always show messages on all lines of multiline diagnostics
196219
trim_whitespaces = false, -- Remove leading/trailing whitespace from each line
197220
tabstop = 4, -- Number of spaces per tab when expanding tabs
198-
severity = nil, -- Filter multiline diagnostics by severity (e.g., { vim.diagnostic.severity.ERROR })
221+
-- Restrict which severities are shown on non-cursor lines
222+
-- With always_show = true: listed severities stay visible on every line,
223+
-- all other severities only appear on the cursor line
224+
severity = nil, -- e.g. { vim.diagnostic.severity.ERROR }
199225
},
200226

201227
-- Show all diagnostics on the current cursor line, not just those under the cursor

0 commit comments

Comments
 (0)