# HG changeset patch # User Zeger Van de Vannet # Date 1632488632 -7200 # Node ID 899cded39cd3138a996afdcfe9a16dccd5b3d6e3 # Parent daf715cd8abef883b8ace1e045d4e9232ec6eb4c Update Diagnostic highlighting after api changes diff -r daf715cd8abe -r 899cded39cd3 .chezmoitemplates/init.lua --- a/.chezmoitemplates/init.lua Thu Sep 23 20:13:52 2021 +0200 +++ b/.chezmoitemplates/init.lua Fri Sep 24 15:03:52 2021 +0200 @@ -669,36 +669,8 @@ inoremap { '', vim.lsp.buf.signature_help, silent = true, buffer = 0 } - vim.fn.sign_define( - 'LspDiagnosticsSignError', - { texthl = 'LspDiagnosticsSignError', linehl = '', numhl = '', text = '▎' } - ) - vim.fn.sign_define('LspDiagnosticsSignWarning', { - texthl = 'LspDiagnosticsSignWarning', - linehl = '', - numhl = '', - text = '▎', - }) - vim.fn.sign_define('LspDiagnosticsSignInformation', { - texthl = 'LspDiagnosticsSignInformation', - linehl = '', - numhl = '', - text = '▎', - }) - vim.fn.sign_define( - 'LspDiagnosticsSignHint', - { texthl = 'LspDiagnosticsSignHint', linehl = '', numhl = '', text = '▎' } - ) - vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'single' }) vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'single' }) - vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - underline = true, - update_in_insert = false, - virtual_text = { severity_limit = 'Warning' }, - source = 'if_many', - }) - -- require "lsp_signature".on_attach() end @@ -773,6 +745,28 @@ vim.highlight.on_yank { timeout = 120 } end +vim.diagnostic.config { + underline = true, + update_in_insert = false, + virtual_text = { severity = { min = vim.diagnostic.severity.WARN }, source = 'always' }, + severity_sort = true, +} + +vim.fn.sign_define('DiagnosticSignError', { texthl = 'DiagnosticSignError', linehl = '', numhl = '', text = '▎' }) +vim.fn.sign_define('DiagnosticSignWarn', { + texthl = 'DiagnosticSignWarn', + linehl = '', + numhl = '', + text = '▎', +}) +vim.fn.sign_define('DiagnosticSignInfo', { + texthl = 'DiagnosticSignInfo', + linehl = '', + numhl = '', + text = '▎', +}) +vim.fn.sign_define('DiagnosticSignHint', { texthl = 'DiagnosticSignHint', linehl = '', numhl = '', text = '▎' }) + -- Try importing local config local ok, localconfig = pcall(require, 'localconfig') if ok then