Skip to content

lib/types: add missing nvim_set_hl attrs - #4540

Draft
khaneliman wants to merge 1 commit into
nix-community:mainfrom
khaneliman:feat/highlight-0-12-attrs
Draft

khaneliman wants to merge 1 commit into
nix-community:mainfrom
khaneliman:feat/highlight-0-12-attrs

Conversation

@khaneliman

@khaneliman khaneliman commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Declares the ten nvim_set_hl attributes from 0.12.4's api.txt that the
highlight submodule lacked. The submodule is freeform so they already reached
Neovim; this puts them in the generated option reference.

Related #4538

Declare the attributes that Neovim 0.12.4's pinned `api.txt` lists for
`nvim_set_hl` but the highlight submodule did not: `fg_indexed`,
`bg_indexed`, `blink`, `overline`, `dim`, `conceal`, `altfont`,
`link_global`, `force`, and `update`.

The submodule is freeform, so these keys already reached Neovim. What
they gain is documentation, so a user can find them without reading
`api.txt`. Booleans use `maybeRaw` and `link_global` follows `link`, so
declaring a key takes away no value shape that `nvim_set_hl` accepts.
Declaring does narrow against the bare freeform type: `force = 1`
evaluated before and now fails, and the keyset agrees it was never valid.

The highlight test exercises these as a realistic configuration. Because
freeform keeps accepting the same values, that alone cannot detect a
removed declaration, so a second case asserts the declarations directly
through `types.highlight.getSubOptions`.

Scope the descriptions to how Nixvim applies highlights. `force` only
matters together with `default`, since `nvim_set_hl` already replaces a
group otherwise. `update` needs the group to exist, so it belongs in
`highlightOverride`, which runs after `colorscheme`. `link_global`
behaves as `link` here, because Nixvim always applies at `ns=0`.
@khaneliman

Copy link
Copy Markdown
Contributor Author

@MattSturgeon @GaetanLepage thoughts on maintenance debt when it comes to things that are actually neovim aligned. I know we didn't like plugins tracking options closely, but didn't know if we wanted to cover some of this stuff.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant