diff options
| author | Lewis Russell <lewis6991@gmail.com> | 2025-01-16 20:53:17 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-16 20:53:17 +0000 |
| commit | fb564ddff0b4ec9dad5afa7548777af1c3044273 (patch) | |
| tree | bece6f53cd54b2b5c85228d689ac88e227b9e250 /src/nvim/options.lua | |
| parent | 92d3bf101d07d52cfbd4c22e6e06251897adda34 (diff) | |
| download | rneovim-fb564ddff0b4ec9dad5afa7548777af1c3044273.tar.gz rneovim-fb564ddff0b4ec9dad5afa7548777af1c3044273.tar.bz2 rneovim-fb564ddff0b4ec9dad5afa7548777af1c3044273.zip | |
refactor(options): generic expand and did_set callbacks (#32011)
* refactor(options): generic expand and did_set callbacks
Problem:
Many options have similar callbacks to check the values are valid.
Solution:
Generalize these callbacks into a single function that reads the option
table.
* refactor: gen_options.lua
refactor: gen_options.lua - inline get_cond
* refactor(options): use a simpler format for the common default
Diffstat (limited to 'src/nvim/options.lua')
| -rw-r--r-- | src/nvim/options.lua | 788 |
1 files changed, 383 insertions, 405 deletions
diff --git a/src/nvim/options.lua b/src/nvim/options.lua index 2425dcb93e..ee8034a871 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -7,13 +7,14 @@ --- @field alias? string|string[] --- @field short_desc? string|fun(): string --- @field varname? string +--- @field flags_varname? string --- @field type vim.option_type --- @field immutable? boolean --- @field list? 'comma'|'onecomma'|'commacolon'|'onecommacolon'|'flags'|'flagscomma' --- @field scope vim.option_scope[] --- @field deny_duplicates? boolean --- @field enable_if? string ---- @field defaults? vim.option_defaults +--- @field defaults? vim.option_defaults|vim.option_value|fun(): string --- @field values? vim.option_valid_values --- @field flags? true|table<string,integer> --- @field secure? true @@ -29,7 +30,11 @@ --- @field no_mkrc? true --- @field alloced? true --- @field redraw? vim.option_redraw[] +--- +--- If not provided and `values` is present, then is set to 'did_set_str_generic' --- @field cb? string +--- +--- If not provided and `values` is present, then is set to 'expand_set_str_generic' --- @field expand_cb? string --- @field tags? string[] @@ -37,14 +42,14 @@ --- @field condition? string --- string: #ifdef string --- !string: #ifndef string ---- @field if_true integer|boolean|string|fun(): string ---- @field if_false? integer|boolean|string +--- @field if_true vim.option_value|fun(): string +--- @field if_false? vim.option_value --- @field doc? string Default to show in options.txt ---- @field meta? integer|boolean|string Default to use in Lua meta files +--- @field meta? string Default to use in Lua meta files --- @alias vim.option_scope 'global'|'buf'|'win' --- @alias vim.option_type 'boolean'|'number'|'string' ---- @alias vim.option_value boolean|number|string +--- @alias vim.option_value boolean|integer|string --- @alias vim.option_valid_values (string|[string,vim.option_valid_values])[] --- @alias vim.option_redraw @@ -81,7 +86,7 @@ local function N_(s) -- luacheck: ignore 211 (currently unused) end -- luacheck: ignore 621 -return { +local options = { cstr = cstr, --- @type string[] valid_scopes = { 'global', 'buf', 'win' }, @@ -90,7 +95,7 @@ return { options = { { abbreviation = 'al', - defaults = { if_true = 224 }, + defaults = 224, full_name = 'aleph', scope = { 'global' }, short_desc = N_('ASCII code of the letter Aleph (Hebrew)'), @@ -99,7 +104,7 @@ return { }, { abbreviation = 'ari', - defaults = { if_true = false }, + defaults = false, desc = [=[ Allow CTRL-_ in Insert mode. This is default off, to avoid that users that accidentally type CTRL-_ instead of SHIFT-_ get into reverse @@ -114,7 +119,7 @@ return { { abbreviation = 'ambw', cb = 'did_set_ambiwidth', - defaults = { if_true = 'single' }, + defaults = 'single', values = { 'single', 'double' }, desc = [=[ Tells Vim what to do with characters with East Asian Width Class @@ -148,7 +153,6 @@ return { set to one of CJK locales. See Unicode Standard Annex #11 (https://www.unicode.org/reports/tr11). ]=], - expand_cb = 'expand_set_ambiwidth', full_name = 'ambiwidth', redraw = { 'all_windows', 'ui_option' }, scope = { 'global' }, @@ -159,7 +163,7 @@ return { { abbreviation = 'arab', cb = 'did_set_arabic', - defaults = { if_true = false }, + defaults = false, desc = [=[ This option can be set to start editing Arabic text. Setting this option will: @@ -184,7 +188,7 @@ return { }, { abbreviation = 'arshape', - defaults = { if_true = true }, + defaults = true, desc = [=[ When on and 'termbidi' is off, the required visual character corrections that need to take place for displaying the Arabic language @@ -209,7 +213,7 @@ return { { abbreviation = 'acd', cb = 'did_set_autochdir', - defaults = { if_true = false }, + defaults = false, desc = [=[ When on, Vim will change the current working directory whenever you open a file, switch buffers, delete a buffer or open/close a window. @@ -226,7 +230,7 @@ return { }, { abbreviation = 'ai', - defaults = { if_true = true }, + defaults = true, desc = [=[ Copy indent from current line when starting a new line (typing <CR> in Insert mode or when using the "o" or "O" command). If you do not @@ -248,7 +252,7 @@ return { }, { abbreviation = 'ar', - defaults = { if_true = true }, + defaults = true, desc = [=[ When a file has been detected to have been changed outside of Vim and it has not been changed inside of Vim, automatically read it again. @@ -268,7 +272,7 @@ return { }, { abbreviation = 'aw', - defaults = { if_true = false }, + defaults = false, desc = [=[ Write the contents of the file, if it has been modified, on each `:next`, `:rewind`, `:last`, `:first`, `:previous`, `:stop`, @@ -293,7 +297,7 @@ return { }, { abbreviation = 'awa', - defaults = { if_true = false }, + defaults = false, desc = [=[ Like 'autowrite', but also used for commands ":edit", ":enew", ":quit", ":qall", ":exit", ":xit", ":recover" and closing the Vim window. @@ -309,7 +313,7 @@ return { { abbreviation = 'bg', cb = 'did_set_background', - defaults = { if_true = 'dark' }, + defaults = 'dark', values = { 'light', 'dark' }, desc = [=[ When set to "dark" or "light", adjusts the default color groups for @@ -335,7 +339,6 @@ return { will change. To use other settings, place ":highlight" commands AFTER the setting of the 'background' option. ]=], - expand_cb = 'expand_set_background', full_name = 'background', scope = { 'global' }, short_desc = N_('"dark" or "light", used for highlight colors'), @@ -345,7 +348,7 @@ return { { abbreviation = 'bs', cb = 'did_set_backspace', - defaults = { if_true = 'indent,eol,start' }, + defaults = 'indent,eol,start', values = { 'indent', 'eol', 'start', 'nostop' }, deny_duplicates = true, desc = [=[ @@ -363,7 +366,6 @@ return { When the value is empty, Vi compatible backspacing is used, none of the ways mentioned for the items above are possible. ]=], - expand_cb = 'expand_set_backspace', full_name = 'backspace', list = 'onecomma', scope = { 'global' }, @@ -373,7 +375,7 @@ return { }, { abbreviation = 'bk', - defaults = { if_true = false }, + defaults = false, desc = [=[ Make a backup before overwriting a file. Leave it around after the file has been successfully written. If you do not want to keep the @@ -463,17 +465,17 @@ return { the system may refuse to do this. In that case the "auto" value will again not rename the file. ]=], - expand_cb = 'expand_set_backupcopy', full_name = 'backupcopy', list = 'onecomma', scope = { 'global', 'buf' }, short_desc = N_("make backup as a copy, don't rename the file"), type = 'string', varname = 'p_bkc', + flags_varname = 'bkc_flags', }, { abbreviation = 'bdir', - defaults = { if_true = '' }, + defaults = '', deny_duplicates = true, desc = [=[ List of directories for the backup file, separated with commas. @@ -529,7 +531,7 @@ return { { abbreviation = 'bex', cb = 'did_set_backupext_or_patchmode', - defaults = { if_true = '~' }, + defaults = '~', desc = [=[ String which is appended to a file name to make the name of the backup file. The default is quite unusual, because this avoids @@ -593,8 +595,7 @@ return { }, { abbreviation = 'bo', - cb = 'did_set_belloff', - defaults = { if_true = 'all' }, + defaults = 'all', values = { 'all', 'backspace', @@ -657,18 +658,18 @@ return { indicate that an error occurred. It can be silenced by adding the "error" keyword. ]=], - expand_cb = 'expand_set_belloff', full_name = 'belloff', list = 'comma', scope = { 'global' }, short_desc = N_('do not ring the bell for these reasons'), type = 'string', varname = 'p_bo', + flags_varname = 'bo_flags', }, { abbreviation = 'bin', cb = 'did_set_binary', - defaults = { if_true = false }, + defaults = false, desc = [=[ This option should be set before editing a binary file. You can also use the |-b| Vim argument. When this option is switched on a few @@ -706,7 +707,7 @@ return { }, { cb = 'did_set_eof_eol_fixeol_bomb', - defaults = { if_true = false }, + defaults = false, desc = [=[ When writing a file and the following conditions are met, a BOM (Byte Order Mark) is prepended to the file: @@ -754,7 +755,7 @@ return { }, { abbreviation = 'bri', - defaults = { if_true = false }, + defaults = false, desc = [=[ Every wrapped line will continue visually indented (same amount of space as the beginning of that line), thus preserving horizontal blocks @@ -769,7 +770,7 @@ return { { abbreviation = 'briopt', cb = 'did_set_breakindentopt', - defaults = { if_true = '' }, + defaults = '', -- Keep this in sync with briopt_check(). values = { 'shift:', 'min:', 'sbr', 'list:', 'column:' }, deny_duplicates = true, @@ -802,7 +803,6 @@ return { added for the 'showbreak' setting. (default: off) ]=], - expand_cb = 'expand_set_breakindentopt', full_name = 'breakindentopt', list = 'onecomma', redraw = { 'current_buffer' }, @@ -833,7 +833,7 @@ return { { abbreviation = 'bh', cb = 'did_set_bufhidden', - defaults = { if_true = '' }, + defaults = '', values = { '', 'hide', 'unload', 'delete', 'wipe' }, desc = [=[ This option specifies what happens when a buffer is no longer @@ -856,7 +856,6 @@ return { This option is used together with 'buftype' and 'swapfile' to specify special kinds of buffers. See |special-buffers|. ]=], - expand_cb = 'expand_set_bufhidden', full_name = 'bufhidden', noglob = true, scope = { 'buf' }, @@ -867,7 +866,7 @@ return { { abbreviation = 'bl', cb = 'did_set_buflisted', - defaults = { if_true = true }, + defaults = true, desc = [=[ When this option is set, the buffer shows up in the buffer list. If it is reset it is not used for ":bnext", "ls", the Buffers menu, etc. @@ -886,7 +885,7 @@ return { { abbreviation = 'bt', cb = 'did_set_buftype', - defaults = { if_true = '' }, + defaults = '', values = { '', 'acwrite', @@ -943,7 +942,6 @@ return { without saving. For writing there must be matching |BufWriteCmd|, |FileWriteCmd| or |FileAppendCmd| autocommands. ]=], - expand_cb = 'expand_set_buftype', full_name = 'buftype', noglob = true, scope = { 'buf' }, @@ -954,8 +952,7 @@ return { }, { abbreviation = 'cmp', - cb = 'did_set_casemap', - defaults = { if_true = 'internal,keepascii' }, + defaults = 'internal,keepascii', values = { 'internal', 'keepascii' }, flags = true, deny_duplicates = true, @@ -970,17 +967,17 @@ return { case mapping, the current locale is not effective. This probably only matters for Turkish. ]=], - expand_cb = 'expand_set_casemap', full_name = 'casemap', list = 'onecomma', scope = { 'global' }, short_desc = N_('specifies how case of letters is changed'), type = 'string', varname = 'p_cmp', + flags_varname = 'cmp_flags', }, { abbreviation = 'cdh', - defaults = { if_true = false }, + defaults = false, desc = [=[ When on, |:cd|, |:tcd| and |:lcd| without an argument changes the current working directory to the |$HOME| directory like in Unix. @@ -1054,7 +1051,7 @@ return { varname = 'p_cedit', }, { - defaults = { if_true = 0 }, + defaults = 0, desc = [=[ |channel| connected to the buffer, or 0 if no channel is connected. In a |:terminal| buffer this is the terminal channel. @@ -1071,7 +1068,7 @@ return { { abbreviation = 'ccv', cb = 'did_set_optexpr', - defaults = { if_true = '' }, + defaults = '', desc = [=[ An expression that is used for character encoding conversion. It is evaluated when a file that is to be read or has been written has a @@ -1127,7 +1124,7 @@ return { }, { abbreviation = 'cin', - defaults = { if_true = false }, + defaults = false, desc = [=[ Enables automatic C program indenting. See 'cinkeys' to set the keys that trigger reindenting in insert mode and 'cinoptions' to set your @@ -1148,7 +1145,7 @@ return { }, { abbreviation = 'cink', - defaults = { if_true = '0{,0},0),0],:,0#,!^F,o,O,e' }, + defaults = '0{,0},0),0],:,0#,!^F,o,O,e', deny_duplicates = true, desc = [=[ A list of keys that, when typed in Insert mode, cause reindenting of @@ -1167,7 +1164,7 @@ return { { abbreviation = 'cino', cb = 'did_set_cinoptions', - defaults = { if_true = '' }, + defaults = '', deny_duplicates = true, desc = [=[ The 'cinoptions' affect the way 'cindent' reindents lines in a C @@ -1183,7 +1180,7 @@ return { }, { abbreviation = 'cinsd', - defaults = { if_true = 'public,protected,private' }, + defaults = 'public,protected,private', deny_duplicates = true, desc = [=[ Keywords that are interpreted as a C++ scope declaration by |cino-g|. @@ -1201,7 +1198,7 @@ return { }, { abbreviation = 'cinw', - defaults = { if_true = 'if,else,while,do,for,switch' }, + defaults = 'if,else,while,do,for,switch', deny_duplicates = true, desc = [=[ These keywords start an extra indent in the next line when @@ -1220,8 +1217,7 @@ return { }, { abbreviation = 'cb', - cb = 'did_set_clipboard', - defaults = { if_true = '' }, + defaults = '', values = { 'unnamed', 'unnamedplus' }, flags = true, desc = [=[ @@ -1249,18 +1245,18 @@ return { "*". See |clipboard|. ]=], deny_duplicates = true, - expand_cb = 'expand_set_clipboard', full_name = 'clipboard', list = 'onecomma', scope = { 'global' }, short_desc = N_('use the clipboard as the unnamed register'), type = 'string', varname = 'p_cb', + flags_varname = 'cb_flags', }, { abbreviation = 'ch', cb = 'did_set_cmdheight', - defaults = { if_true = 1 }, + defaults = 1, desc = [=[ Number of screen lines to use for the command-line. Helps avoiding |hit-enter| prompts. @@ -1285,7 +1281,7 @@ return { }, { abbreviation = 'cwh', - defaults = { if_true = 7 }, + defaults = 7, desc = [=[ Number of screen lines to use for the command-line window. |cmdwin| ]=], @@ -1298,7 +1294,7 @@ return { { abbreviation = 'cc', cb = 'did_set_colorcolumn', - defaults = { if_true = '' }, + defaults = '', deny_duplicates = true, desc = [=[ 'colorcolumn' is a comma-separated list of screen columns that are @@ -1353,7 +1349,7 @@ return { { abbreviation = 'com', cb = 'did_set_comments', - defaults = { if_true = 's1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-,fb:•' }, + defaults = 's1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-,fb:•', deny_duplicates = true, desc = [=[ A comma-separated list of strings that can start a comment line. See @@ -1371,7 +1367,7 @@ return { { abbreviation = 'cms', cb = 'did_set_commentstring', - defaults = { if_true = '' }, + defaults = '', desc = [=[ A template for a comment. The "%s" in the value is replaced with the comment text, and should be padded with a space when possible. @@ -1386,7 +1382,7 @@ return { }, { abbreviation = 'cp', - defaults = { if_true = false }, + defaults = false, full_name = 'compatible', scope = { 'global' }, short_desc = N_('No description'), @@ -1396,7 +1392,7 @@ return { { abbreviation = 'cpt', cb = 'did_set_complete', - defaults = { if_true = '.,w,b,u,t' }, + defaults = '.,w,b,u,t', values = { '.', 'w', 'b', 'u', 'k', 'kspell', 's', 'i', 'd', ']', 't', 'U', 'f' }, deny_duplicates = true, desc = [=[ @@ -1433,7 +1429,6 @@ return { based expansion (e.g., dictionary |i_CTRL-X_CTRL-K|, included patterns |i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions). ]=], - expand_cb = 'expand_set_complete', full_name = 'complete', list = 'onecomma', scope = { 'buf' }, @@ -1445,7 +1440,7 @@ return { { abbreviation = 'cfu', cb = 'did_set_completefunc', - defaults = { if_true = '' }, + defaults = '', desc = [=[ This option specifies a function to be used for Insert mode completion with CTRL-X CTRL-U. |i_CTRL-X_CTRL-U| @@ -1467,7 +1462,7 @@ return { { abbreviation = 'cia', cb = 'did_set_completeitemalign', - defaults = { if_true = 'abbr,kind,menu' }, + defaults = 'abbr,kind,menu', flags = true, deny_duplicates = true, desc = [=[ @@ -1488,7 +1483,7 @@ return { { abbreviation = 'cot', cb = 'did_set_completeopt', - defaults = { if_true = 'menu,preview' }, + defaults = 'menu,preview', values = { 'menu', 'menuone', @@ -1543,18 +1538,18 @@ return { list of alternatives, but not how the candidates are collected (using different completion types). ]=], - expand_cb = 'expand_set_completeopt', full_name = 'completeopt', list = 'onecomma', scope = { 'global', 'buf' }, short_desc = N_('options for Insert mode completion'), type = 'string', varname = 'p_cot', + flags_varname = 'cot_flags', }, { abbreviation = 'csl', cb = 'did_set_completeslash', - defaults = { if_true = '' }, + defaults = '', values = { '', 'slash', 'backslash' }, desc = [=[ only modifiable in MS-Windows @@ -1570,7 +1565,6 @@ return { command line completion the global value is used. ]=], enable_if = 'BACKSLASH_IN_FILENAME', - expand_cb = 'expand_set_completeslash', full_name = 'completeslash', scope = { 'buf' }, type = 'string', @@ -1579,7 +1573,7 @@ return { { abbreviation = 'cocu', cb = 'did_set_concealcursor', - defaults = { if_true = '' }, + defaults = '', desc = [=[ Sets the modes in which text in the cursor line can also be concealed. When the current mode is listed then concealing happens just like in @@ -1607,7 +1601,7 @@ return { }, { abbreviation = 'cole', - defaults = { if_true = 0 }, + defaults = 0, desc = [=[ Determine how text with the "conceal" syntax attribute |:syn-conceal| is shown: @@ -1636,7 +1630,7 @@ return { }, { abbreviation = 'cf', - defaults = { if_true = false }, + defaults = false, desc = [=[ When 'confirm' is on, certain operations that would normally fail because of unsaved changes to a buffer, e.g. ":q" and ":e", @@ -1655,7 +1649,7 @@ return { }, { abbreviation = 'ci', - defaults = { if_true = false }, + defaults = false, desc = [=[ Copy the structure of the existing lines indent when autoindenting a new line. Normally the new indent is reconstructed by a series of @@ -1676,7 +1670,7 @@ return { { abbreviation = 'cpo', cb = 'did_set_cpoptions', - defaults = { if_true = macros('CPO_VIM', 'string') }, + defaults = macros('CPO_VIM', 'string'), desc = [=[ A sequence of single character flags. When a character is present this indicates Vi-compatible behavior. This is used for things where @@ -1918,7 +1912,7 @@ return { }, { abbreviation = 'crb', - defaults = { if_true = false }, + defaults = false, desc = [=[ When this option is set, as the cursor in the current window moves other cursorbound windows (windows that also have @@ -1935,7 +1929,7 @@ return { }, { abbreviation = 'cuc', - defaults = { if_true = false }, + defaults = false, desc = [=[ Highlight the screen column of the cursor with CursorColumn |hl-CursorColumn|. Useful to align text. Will make screen redrawing @@ -1954,7 +1948,7 @@ return { }, { abbreviation = 'cul', - defaults = { if_true = false }, + defaults = false, desc = [=[ Highlight the text line of the cursor with CursorLine |hl-CursorLine|. Useful to easily spot the cursor. Will make screen redrawing slower. @@ -1970,7 +1964,7 @@ return { { abbreviation = 'culopt', cb = 'did_set_cursorlineopt', - defaults = { if_true = 'both' }, + defaults = 'both', -- Keep this in sync with fill_culopt_flags(). values = { 'line', 'screenline', 'number', 'both' }, flags = { @@ -1994,7 +1988,6 @@ return { "line" and "screenline" cannot be used together. ]=], - expand_cb = 'expand_set_cursorlineopt', full_name = 'cursorlineopt', list = 'onecomma', redraw = { 'current_window', 'highlight_only' }, @@ -2003,8 +1996,7 @@ return { type = 'string', }, { - cb = 'did_set_debug', - defaults = { if_true = '' }, + defaults = '', values = { 'msg', 'throw', 'beep' }, desc = [=[ These values can be used: @@ -2019,7 +2011,6 @@ return { 'indentexpr'. ]=], -- TODO(lewis6991): bug, values currently cannot be combined - expand_cb = 'expand_set_debug', full_name = 'debug', list = 'comma', scope = { 'global' }, @@ -2029,7 +2020,7 @@ return { }, { abbreviation = 'def', - defaults = { if_true = '' }, + defaults = '', desc = [=[ Pattern to be used to find a macro definition. It is a search pattern, just like for the "/" command. This option is used for the @@ -2059,7 +2050,7 @@ return { }, { abbreviation = 'deco', - defaults = { if_true = false }, + defaults = false, desc = [=[ If editing Unicode and this option is set, backspace and Normal mode "x" delete each combining character on its own. When it is off (the @@ -2079,7 +2070,7 @@ return { }, { abbreviation = 'dict', - defaults = { if_true = '' }, + defaults = '', deny_duplicates = true, desc = [=[ List of file names, separated by commas, that are used to lookup words @@ -2116,7 +2107,7 @@ return { }, { cb = 'did_set_diff', - defaults = { if_true = false }, + defaults = false, desc = [=[ Join the current window in the group of windows that shows differences between files. See |diff-mode|. @@ -2131,7 +2122,7 @@ return { { abbreviation = 'dex', cb = 'did_set_optexpr', - defaults = { if_true = '' }, + defaults = '', desc = [=[ Expression which is evaluated to obtain a diff file (either ed-style or unified-style) from two versions of a file. See |diff-diffexpr|. @@ -2149,7 +2140,7 @@ return { { abbreviation = 'dip', cb = 'did_set_diffopt', - defaults = { if_true = 'internal,filler,closeoff' }, + defaults = 'internal,filler,closeoff', -- Keep this in sync with diffopt_changed(). values = { 'filler', @@ -2290,7 +2281,7 @@ return { }, { abbreviation = 'dg', - defaults = { if_true = false }, + defaults = false, desc = [=[ Enable the entering of digraphs in Insert mode with {char1} <BS> {char2}. See |digraphs|. @@ -2303,7 +2294,7 @@ return { }, { abbreviation = 'dir', - defaults = { if_true = '' }, + defaults = '', deny_duplicates = true, desc = [=[ List of directory names for the swap file, separated with commas. @@ -2361,7 +2352,7 @@ return { { abbreviation = 'dy', cb = 'did_set_display', - defaults = { if_true = 'lastline' }, + defaults = 'lastline', values = { 'lastline', 'truncate', 'uhex', 'msgsep' }, flags = true, deny_duplicates = true, @@ -2384,7 +2375,6 @@ return { The "@" character can be changed by setting the "lastline" item in 'fillchars'. The character is highlighted with |hl-NonText|. ]=], - expand_cb = 'expand_set_display', full_name = 'display', list = 'onecomma', redraw = { 'all_windows' }, @@ -2392,11 +2382,11 @@ return { short_desc = N_('list of flags for how to display text'), type = 'string', varname = 'p_dy', + flags_varname = 'dy_flags', }, { abbreviation = 'ead', - cb = 'did_set_eadirection', - defaults = { if_true = 'both' }, + defaults = 'both', values = { 'both', 'ver', 'hor' }, desc = [=[ Tells when the 'equalalways' option applies: @@ -2404,7 +2394,6 @@ return { hor horizontally, height of windows is not affected both width and height of windows is affected ]=], - expand_cb = 'expand_set_eadirection', full_name = 'eadirection', scope = { 'global' }, short_desc = N_("in which direction 'equalalways' works"), @@ -2413,7 +2402,7 @@ return { }, { abbreviation = 'ed', - defaults = { if_true = false }, + defaults = false, full_name = 'edcompatible', scope = { 'global' }, short_desc = N_('No description'), @@ -2422,8 +2411,8 @@ return { }, { abbreviation = 'emo', - cb = 'did_set_ambiwidth', - defaults = { if_true = true }, + cb = 'did_set_emoji', + defaults = true, desc = [=[ When on all Unicode emoji characters are considered to be full width. This excludes "text emoji" characters, which are normally displayed as @@ -2444,7 +2433,7 @@ return { { abbreviation = 'enc', cb = 'did_set_encoding', - defaults = { if_true = macros('ENC_DFLT', 'string') }, + defaults = macros('ENC_DFLT', 'string'), deny_in_modelines = true, desc = [=[ String-encoding used internally and for |RPC| communication. @@ -2461,7 +2450,7 @@ return { { abbreviation = 'eof', cb = 'did_set_eof_eol_fixeol_bomb', - defaults = { if_true = false }, + defaults = false, desc = [=[ Indicates that a CTRL-Z character was found at the end of the file when reading it. Normally only happens when 'fileformat' is "dos". @@ -2481,7 +2470,7 @@ return { { abbreviation = 'eol', cb = 'did_set_eof_eol_fixeol_bomb', - defaults = { if_true = true }, + defaults = true, desc = [=[ When writing a file and this option is off and the 'binary' option is on, or 'fixeol' option is off, no <EOL> will be written for the @@ -2507,7 +2496,7 @@ return { { abbreviation = 'ea', cb = 'did_set_equalalways', - defaults = { if_true = true }, + defaults = true, desc = [=[ When on, all the windows are automatically made the same size after splitting or closing a window. This also happens the moment the @@ -2532,7 +2521,7 @@ return { }, { abbreviation = 'ep', - defaults = { if_true = '' }, + defaults = '', desc = [=[ External program to use for "=" command. When this option is empty the internal formatting functions are used; either 'lisp', 'cindent' @@ -2552,7 +2541,7 @@ return { }, { abbreviation = 'eb', - defaults = { if_true = false }, + defaults = false, desc = [=[ Ring the bell (beep or screen flash) for error messages. This only makes a difference for error messages, the bell will be used always @@ -2568,7 +2557,7 @@ return { }, { abbreviation = 'ef', - defaults = { if_true = macros('DFLT_ERRORFILE', 'string') }, + defaults = macros('DFLT_ERRORFILE', 'string'), desc = [=[ Name of the errorfile for the QuickFix mode (see |:cf|). When the "-q" command-line argument is used, 'errorfile' is set to the @@ -2608,7 +2597,7 @@ return { { abbreviation = 'ei', cb = 'did_set_eventignore', - defaults = { if_true = '' }, + defaults = '', deny_duplicates = true, desc = [=[ A list of autocommand event names, which are to be ignored. @@ -2628,7 +2617,7 @@ return { }, { abbreviation = 'et', - defaults = { if_true = false }, + defaults = false, desc = [=[ In Insert mode: Use the appropriate number of spaces to insert a <Tab>. Spaces are used in indents with the '>' and '<' commands and @@ -2643,7 +2632,7 @@ return { }, { abbreviation = 'ex', - defaults = { if_true = false }, + defaults = false, desc = [=[ Automatically execute .nvim.lua, .nvimrc, and .exrc files in the current directory, if the file is in the |trust| list. Use |:trust| to @@ -2666,7 +2655,7 @@ return { { abbreviation = 'fenc', cb = 'did_set_encoding', - defaults = { if_true = '' }, + defaults = '', desc = [=[ File-content encoding for the current buffer. Conversion is done with iconv() or as specified with 'charconvert'. @@ -2718,7 +2707,7 @@ return { }, { abbreviation = 'fencs', - defaults = { if_true = 'ucs-bom,utf-8,default,latin1' }, + defaults = 'ucs-bom,utf-8,default,latin1', deny_duplicates = true, desc = [=[ This is a list of character encodings considered when starting to edit @@ -2803,7 +2792,6 @@ return { option is set, because the file would be different when written. This option cannot be changed when 'modifiable' is off. ]=], - expand_cb = 'expand_set_fileformat', full_name = 'fileformat', no_mkrc = true, redraw = { 'curswant', 'statuslines' }, @@ -2814,7 +2802,7 @@ return { }, { abbreviation = 'ffs', - cb = 'did_set_fileformats', + cb = 'did_set_str_generic', defaults = { condition = 'USE_CRNL', if_true = 'dos,unix', @@ -2869,7 +2857,7 @@ return { used. Also see |file-formats|. ]=], - expand_cb = 'expand_set_fileformat', + expand_cb = 'expand_set_str_generic', full_name = 'fileformats', list = 'onecomma', scope = { 'global' }, @@ -2899,7 +2887,7 @@ return { { abbreviation = 'ft', cb = 'did_set_filetype_or_syntax', - defaults = { if_true = '' }, + defaults = '', desc = [=[ When this option is set, the FileType autocommand event is triggered. All autocommands that match with the value of this option will be @@ -2934,7 +2922,7 @@ return { { abbreviation = 'fcs', cb = 'did_set_chars_option', - defaults = { if_true = '' }, + defaults = '', deny_duplicates = true, desc = [=[ Characters to fill the statuslines, vertical separators and special @@ -3009,7 +2997,7 @@ return { { abbreviation = 'ffu', cb = 'did_set_findfunc', - defaults = { if_true = '' }, + defaults = '', desc = [=[ Function that is called to obtain the filename(s) for the |:find| command. When this option is empty, the internal |file-searching| @@ -3069,7 +3057,7 @@ return { { abbreviation = 'fixeol', cb = 'did_set_eof_eol_fixeol_bomb', - defaults = { if_true = true }, + defaults = true, desc = [=[ When writing a file and this option is on, <EOL> at the end of file will be restored if missing. Turn this option off if you want to @@ -3088,8 +3076,7 @@ return { }, { abbreviation = 'fcl', - cb = 'did_set_foldclose', - defaults = { if_true = '' }, + defaults = '', values = { 'all' }, deny_duplicates = true, desc = [=[ @@ -3097,7 +3084,6 @@ return { its level is higher than 'foldlevel'. Useful if you want folds to automatically close when moving out of them. ]=], - expand_cb = 'expand_set_foldclose', full_name = 'foldclose', list = 'onecomma', redraw = { 'current_window' }, @@ -3108,8 +3094,7 @@ return { }, { abbreviation = 'fdc', - cb = 'did_set_foldcolumn', - defaults = { if_true = '0' }, + defaults = '0', values = { 'auto', 'auto:1', @@ -3141,7 +3126,6 @@ return { "[1-9]": to display a fixed number of columns See |folding|. ]=], - expand_cb = 'expand_set_foldcolumn', full_name = 'foldcolumn', |