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.
This commit is contained in:
Artem Krinitsyn
2026-06-02 22:36:03 +00:00
committed by GitHub
parent cf9ad39267
commit 738cd366f9
4 changed files with 43 additions and 29 deletions

View File

@@ -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