fix(api): nvim_get_hl drops groups defined with link_global #38492

Problem: hlgroup2dict passes &ns_id to ns_get_hl twice. The first call
(link=true) sets *ns_hl = 0 when link_global is set, so the second call
and the sg_cleared guard both see ns_id == 0 and bail out. The group is
silently dropped from the result.

Solution: use a temporary copy of ns_id for each ns_get_hl call so the
original value is preserved.
This commit is contained in:
glepnir
2026-04-12 20:38:35 +08:00
committed by GitHub
parent 2f6c560002
commit 49086862fc
8 changed files with 57 additions and 35 deletions

View File

@@ -329,7 +329,7 @@ error('Cannot require a meta file')
--- @field special? integer|string
--- @field sp? integer|string
--- @field link? integer|string
--- @field global_link? integer|string
--- @field link_global? integer|string
--- @field fallback? boolean
--- @field blend? integer
--- @field fg_indexed? boolean