From 791e400858ae8d32f974b40c4e1c0d54b66f610f Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Sat, 19 Feb 2022 08:38:14 -0800 Subject: fix: lsp and diagnostic highlight priority (#17461) Closes https://github.com/neovim/neovim/issues/17456 * treesitter uses the default highlight priority of 50 * diagnostic highlights have a priority of 150 * lsp reference highlights have a priority of 200 This ensures proper ordering. --- runtime/lua/vim/diagnostic.lua | 5 ++++- runtime/lua/vim/lsp/util.lua | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index b4537c2882..fda70b4e95 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -920,7 +920,10 @@ M.handlers.underline = { underline_ns, higroup, { diagnostic.lnum, diagnostic.col }, - { diagnostic.end_lnum, diagnostic.end_col } + { diagnostic.end_lnum, diagnostic.end_col }, + 'v', + false, + 150 ) end save_extmarks(underline_ns, bufnr) diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index d22c00ae76..d93331c12f 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -1551,9 +1551,9 @@ do --[[ References ]] document_highlight_kind[kind], { start_line, start_idx }, { end_line, end_idx }, - nil, + 'v', false, - 40) + 200) end end end -- cgit