diff options
Diffstat (limited to 'runtime/lua/vim/diagnostic.lua')
-rw-r--r-- | runtime/lua/vim/diagnostic.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 56532d0184..714038f8e4 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -483,6 +483,7 @@ local function next_diagnostic(position, search_forward, bufnr, opts, namespace) local diagnostics = get_diagnostics(bufnr, vim.tbl_extend('keep', opts, { namespace = namespace }), true) local line_diagnostics = diagnostic_lines(diagnostics) + for i = 0, line_count do local offset = i * (search_forward and 1 or -1) local lnum = position[1] + offset @@ -752,6 +753,7 @@ end ---@field message string ---@field source nil|string ---@field code nil|string +---@field _tags { deprecated: boolean, unnecessary: boolean} ---@field user_data nil|any arbitrary data plugins can add --- Get current diagnostics. @@ -948,6 +950,16 @@ M.handlers.underline = { higroup = underline_highlight_map.Error end + if diagnostic._tags then + -- TODO(lewis6991): we should be able to stack these. + if diagnostic._tags.unnecessary then + higroup = 'DiagnosticUnnecessary' + end + if diagnostic._tags.deprecated then + higroup = 'DiagnosticDeprecated' + end + end + vim.highlight.range( bufnr, underline_ns, |