fix(builtin.vim_options): fix getting current option values (#3258)
* fix(builtin.vim_options): fix getting current option values * fix: get options properly and skip invalid options * fix: move option getting out of entry maker * fix: fix toggle of booleans * style: fix formatting
This commit is contained in:
@@ -1003,21 +1003,13 @@ function make_entry.gen_from_vimoptions(opts)
|
||||
display = make_display,
|
||||
value = {
|
||||
name = o.name,
|
||||
value = o.default,
|
||||
value = o.value,
|
||||
type = o.type,
|
||||
scope = o.scope,
|
||||
},
|
||||
ordinal = string.format("%s %s %s", o.name, o.type, o.scope),
|
||||
ordinal = string.format("%s %s %s %s", o.name, o.type, o.scope, utils.display_termcodes(tostring(o.value))),
|
||||
}
|
||||
|
||||
local ok, value = pcall(vim.api.nvim_get_option, o.name)
|
||||
if ok then
|
||||
entry.value.value = value
|
||||
entry.ordinal = entry.ordinal .. " " .. utils.display_termcodes(tostring(value))
|
||||
else
|
||||
entry.ordinal = entry.ordinal .. " " .. utils.display_termcodes(tostring(o.default))
|
||||
end
|
||||
|
||||
return make_entry.set_default_entry_mt(entry, opts)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user