fix(api): expose fg_indexed/bg_indexed in nvim_get_hl (#39240)

Problem: fg_indexed/bg_indexed were dropped from nvim_get_hl output due
to a wrong short_keys guard. HL_FG_INDEXED also wasn't cleared in
hl_blend_attrs, and HLATTRS_DICT_SIZE was too small.

Solution: Remove the short_keys guard, clear HL_FG_INDEXED in
hl_blend_attrs, bump HLATTRS_DICT_SIZE to 24, and clarify docs that
these flags mean rgb is an approximation of the cterm palette index.

(cherry picked from commit 01861c2f95)

Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
Justin M. Keyes
2026-04-20 05:46:55 -04:00
committed by GitHub
parent 5153006747
commit eaa8cff0bd
7 changed files with 50 additions and 24 deletions

View File

@@ -152,13 +152,15 @@ error('Cannot require a meta file')
--- @field background? integer
--- @class vim.api.keyset.get_hl_info : vim.api.keyset.hl_info.base
--- @field fg? integer
--- @field bg? integer
--- @field sp? integer
--- @field default? true
--- @field link? string
--- @field blend? integer
--- @field bg? integer
--- @field bg_indexed? boolean
--- @field cterm? vim.api.keyset.hl_info.cterm
--- @field default? true
--- @field fg? integer
--- @field fg_indexed? boolean
--- @field link? string
--- @field sp? integer
--- @class vim.api.keyset.set_hl_info : vim.api.keyset.hl_info.base
--- @field fg? integer|string