feat(api): tab-local option scope #39811

Problem:
2d795face6 added support for tab-local options ('cmdheight')
to `nvim_get_option_value`, but not to:

    nvim_get_option_info2()
    nvim_set_option_value(…, { tab = … })
    gettabwinvar()

Solution:
- Update `options.lua` to model tab-local options. Introduce `kOptScopeTab`.
- Handle tab scope in the options layer so it works for all options APIs.

Note:
- No change to `gettabvar()`. Not sure if needed/wanted.

fix https://github.com/neovim/neovim/issues/31140
This commit is contained in:
Justin M. Keyes
2026-05-17 10:24:46 -04:00
committed by GitHub
parent c55b6128f8
commit e572c9c80a
15 changed files with 297 additions and 173 deletions

View File

@@ -88,7 +88,7 @@ end
local options = {
cstr = cstr,
--- @type string[]
valid_scopes = { 'global', 'buf', 'win' },
valid_scopes = { 'global', 'buf', 'win', 'tab' },
--- @type vim.option_meta[]
--- The order of the options MUST be alphabetic for ":set all".
options = {
@@ -1350,7 +1350,7 @@ local options = {
]=],
full_name = 'cmdheight',
redraw = { 'all_windows' },
scope = { 'global' },
scope = { 'global', 'tab' },
short_desc = N_('number of lines to use for the command-line'),
type = 'number',
varname = 'p_ch',