1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00

nvim/lua/user/options.lua: configure diagnostic float window

This commit is contained in:
Henrik Hautakoski 2025-12-06 06:49:10 +01:00
parent eb5c9d95bd
commit f1c92c0ec4

View file

@ -85,7 +85,6 @@ vim.o.fillchars = string.format([[eob: ,fold: ,foldopen:%s,foldsep:%s,foldclose:
vim.o.spell = true vim.o.spell = true
vim.o.spelllang = 'en_us' vim.o.spelllang = 'en_us'
vim.diagnostic.config({ vim.diagnostic.config({
virtual_text = false, virtual_text = false,
severity_sort = true, severity_sort = true,
@ -98,11 +97,25 @@ vim.diagnostic.config({
[vim.diagnostic.severity.HINT] = icons.diagnostics.hint [vim.diagnostic.severity.HINT] = icons.diagnostics.hint
}, },
}, },
float = { float = {
---@diagnostic disable-next-line: assign-type-mismatch ---@diagnostic disable-next-line: assign-type-mismatch
border = { " " }, border = 'none',
header = "", header = '',
source = true, source = false,
prefix = function (diagnostic, _, _)
local hl = {
[vim.diagnostic.severity.ERROR] = "DiagnosticError",
[vim.diagnostic.severity.WARN] = "DiagnosticWarn",
[vim.diagnostic.severity.INFO] = "DiagnosticInfo",
[vim.diagnostic.severity.HINT] = "DiagnosticHint"
}
return "", hl[diagnostic.severity]
end,
suffix = function (diagnostic, _, _)
return " " .. diagnostic.source .. " ", "TextMute"
end,
} }
}) })