Skip to content

Commit 253732e

Browse files
committed
fix: remove unnecessary diagnostic config lines
The following lines do nothing and can be removed: format = function(diagnostic) local diagnostic_message = { [vim.diagnostic.severity.ERROR] = diagnostic.message, [vim.diagnostic.severity.WARN] = diagnostic.message, [vim.diagnostic.severity.INFO] = diagnostic.message, [vim.diagnostic.severity.HINT] = diagnostic.message, } return diagnostic_message[diagnostic.severity] end, The following line also serves little purpose, seemingly only reducing the spacing between the end of lines and diagnostic virtual text by two characters, so it can also be removed: spacing = 2, The following line causes diagnostics which aren't of severity level error to not have the specific text area underlined. This is less useful than the default of showing underlines for all diagnostic levels, so remove this line as well: underline = { severity = vim.diagnostic.severity.ERROR },
1 parent 6ba2408 commit 253732e

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

init.lua

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,6 @@ require('lazy').setup({
631631
vim.diagnostic.config {
632632
severity_sort = true,
633633
float = { border = 'rounded', source = 'if_many' },
634-
underline = { severity = vim.diagnostic.severity.ERROR },
635634
signs = vim.g.have_nerd_font and {
636635
text = {
637636
[vim.diagnostic.severity.ERROR] = '󰅚 ',
@@ -642,16 +641,6 @@ require('lazy').setup({
642641
} or {},
643642
virtual_text = {
644643
source = 'if_many',
645-
spacing = 2,
646-
format = function(diagnostic)
647-
local diagnostic_message = {
648-
[vim.diagnostic.severity.ERROR] = diagnostic.message,
649-
[vim.diagnostic.severity.WARN] = diagnostic.message,
650-
[vim.diagnostic.severity.INFO] = diagnostic.message,
651-
[vim.diagnostic.severity.HINT] = diagnostic.message,
652-
}
653-
return diagnostic_message[diagnostic.severity]
654-
end,
655644
},
656645
}
657646

0 commit comments

Comments
 (0)