diff options
author | Famiu Haque <famiuhaque@proton.me> | 2024-03-25 03:14:00 +0600 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-03-26 20:56:42 +0000 |
commit | de87197fdc3aa8123a060fc3a780e087c8e258ac (patch) | |
tree | 202d0097c36178fe6565781789667fe8390a6eba /src/nvim/options.lua | |
parent | d3771e68a2a6be47a3ec158c9b0aff892a9038b9 (diff) | |
download | rneovim-de87197fdc3aa8123a060fc3a780e087c8e258ac.tar.gz rneovim-de87197fdc3aa8123a060fc3a780e087c8e258ac.tar.bz2 rneovim-de87197fdc3aa8123a060fc3a780e087c8e258ac.zip |
refactor(options): make `immutable` and `hidden` options distinct
Problem: Currently, the `immutable` property of options can be applied for options that are hidden and options whose value simply can't be changed. Which is problematic when attempting to convert an option like `'maxcombine'` into an immutable option, because trying to `:set` an immutable option currently gives an error, which is only desired behavior for hidden options, not options that are actually immutable.
Solution: Separate the `immutable` property into two distinct `hidden` and `immutable` properties. Change all options with the `immutable` property to use the `hidden` property instead. Also add `p_mco` as an `immutable` option, as its value cannot be changed, and the underlying variable is not used anywhere.
Diffstat (limited to 'src/nvim/options.lua')
-rw-r--r-- | src/nvim/options.lua | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/nvim/options.lua b/src/nvim/options.lua index 9345a1e9f4..26a0c1a3a9 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -7,6 +7,7 @@ --- @field varname? string --- @field pv_name? string --- @field type 'boolean'|'number'|'string' +--- @field hidden? boolean --- @field immutable? boolean --- @field list? 'comma'|'onecomma'|'commacolon'|'onecommacolon'|'flags'|'flagscomma' --- @field scope vim.option_scope[] @@ -1340,7 +1341,7 @@ return { scope = { 'global' }, short_desc = N_('No description'), type = 'boolean', - immutable = true, + hidden = true, }, { abbreviation = 'cpt', @@ -2299,7 +2300,7 @@ return { scope = { 'global' }, short_desc = N_('No description'), type = 'boolean', - immutable = true, + hidden = true, }, { abbreviation = 'emo', @@ -3888,7 +3889,7 @@ return { scope = { 'global' }, short_desc = N_('No description'), type = 'boolean', - immutable = true, + hidden = true, }, { abbreviation = 'hkp', @@ -3897,7 +3898,7 @@ return { scope = { 'global' }, short_desc = N_('No description'), type = 'boolean', - immutable = true, + hidden = true, }, { abbreviation = 'hls', @@ -4295,7 +4296,7 @@ return { scope = { 'global' }, short_desc = N_('No description'), type = 'boolean', - immutable = true, + hidden = true, }, { abbreviation = 'isf', @@ -5141,12 +5142,12 @@ return { }, { abbreviation = 'mco', - defaults = { if_true = 6 }, + defaults = { if_true = imacros('MAX_MCO') }, full_name = 'maxcombine', scope = { 'global' }, short_desc = N_('maximum nr of combining characters displayed'), type = 'number', - varname = 'p_mco', + immutable = true, }, { abbreviation = 'mfd', @@ -6047,7 +6048,7 @@ return { scope = { 'global' }, short_desc = N_('enable prompt in Ex mode'), type = 'boolean', - immutable = true, + hidden = true, }, { abbreviation = 'pb', @@ -6304,7 +6305,7 @@ return { scope = { 'global' }, short_desc = N_('No description'), type = 'boolean', - immutable = true, + hidden = true, }, { defaults = { if_true = 2 }, @@ -8843,7 +8844,7 @@ return { scope = { 'global' }, short_desc = N_('No description'), type = 'boolean', - immutable = true, + hidden = true, }, { abbreviation = 'tw', @@ -9088,7 +9089,7 @@ return { scope = { 'global' }, short_desc = N_('No description'), type = 'boolean', - immutable = true, + hidden = true, }, { abbreviation = 'udir', |