Neovim's generated keyset types `fg`, `bg`, `sp`, `ctermfg`, `ctermbg`,
and `link` as `integer|string`, and `nvim_set_hl` accepts an integer for
each. Verified against the pinned 0.12.4:
nvim_set_hl(0, "X", { fg = 16711680, ctermfg = 1 })
Nixvim declared all six through `mkNullOrStr`, so those values failed to
evaluate even though the highlight submodule is freeform and would
otherwise have passed them through.
Widen them to `either int str`. An integer means a different thing per
attribute, so say which in each description: `fg`, `bg`, and `sp` take a
24-bit RGB value, `ctermfg` and `ctermbg` take a palette index, and
`link` takes a highlight group id.
`mkNullOrStr` has no remaining use in this file, so drop the import.
`mkNullOrStr` is `maybeRaw str`, so the string attributes of the
highlight submodule already take raw Lua. `5ae4714e` added that for
strings only, which left every boolean and `blend` on a plain type that
rejects it.
Wrap those in `maybeRaw` as well, so computing any highlight attribute
in Lua no longer needs a workaround for the ones that happen to be
booleans.
Instead of relying on option `apply` functions to coerce the value to
rawLua, this can be done in the type's merge function.
Inspired by `types.coercedTo` in nixpkgs.
This commit adds a `plugins.<name>.luaConfig` section controlling the
plugin specific configuration.
The section contains the internal `init` option, containing the plugin's
initialization code.
It also contains the public `pre` and `post` options, that allow to add
code before & after the `init` section
Finally, it contains the `final` option, being the concatenation of the
three previous options.
Define `call = callPackageWith { inherit pkgs lib helpers; }`, which can
be used to automatically pass the correct args into helpers files.
`helpers` is passed in recursively.