From 738cd366f99e2bdf9b7c55b292997c934845a109 Mon Sep 17 00:00:00 2001 From: Artem Krinitsyn Date: Tue, 2 Jun 2026 22:36:03 +0000 Subject: fix(diagnostic): stack _tags hl-groups in a single extmark #38654 Problem: Diagnostic highlight groups were applied by iterating and calling `vim.hl.range` for each group individually. That resulted in multiple extmarks with the same priority being created separately, which does not allow `DiagnosticUnnecessary` and `DiagnosticDeprecated` with matching options override `Diagnostic*` styling. Solution: Pass the list of hl-groups to `vim.hl.range` so they are applied together in the correct order. --- runtime/lua/vim/hl.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim/hl.lua') diff --git a/runtime/lua/vim/hl.lua b/runtime/lua/vim/hl.lua index 08307457b1..8fc921b5a1 100644 --- a/runtime/lua/vim/hl.lua +++ b/runtime/lua/vim/hl.lua @@ -40,7 +40,8 @@ M.priorities = { --- ---@param buf integer Buffer number to apply highlighting to ---@param ns integer Namespace to add highlight to ----@param higroup string Highlight group to use for highlighting +---@param higroup integer|integer[]|string|string[] Highlight group used for the text range. +--- See the `hl_group` option in |nvim_buf_set_extmark()|. ---@param start [integer,integer]|string Start of region as a (line, column) tuple or string accepted by |getpos()| ---@param finish [integer,integer]|string End of region as a (line, column) tuple or string accepted by |getpos()| ---@param opts? vim.hl.range.Opts -- cgit