mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 01:16:31 +00:00
refactor(options): autogenerate valid values and flag enums for options (#31089)
Problem: Option metadata like list of valid values for an option and option flags are not listed in the `options.lua` file and are instead manually defined in C, which means option metadata is split between several places. Solution: Put metadata such as list of valid values for an option and option flags in `options.lua`, and autogenerate the corresponding C variables and enums. Supersedes #28659 Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
@@ -402,7 +402,7 @@ int spell_check_sps(void)
|
||||
if (*s != NUL && !ascii_isdigit(*s)) {
|
||||
f = -1;
|
||||
}
|
||||
// Note: Keep this in sync with p_sps_values.
|
||||
// Note: Keep this in sync with opt_sps_values.
|
||||
} else if (strcmp(buf, "best") == 0) {
|
||||
f = SPS_BEST;
|
||||
} else if (strcmp(buf, "fast") == 0) {
|
||||
@@ -464,7 +464,7 @@ void spell_suggest(int count)
|
||||
// Use the Visually selected text as the bad word. But reject
|
||||
// a multi-line selection.
|
||||
if (curwin->w_cursor.lnum != VIsual.lnum) {
|
||||
vim_beep(BO_SPELL);
|
||||
vim_beep(kOptBoFlagSpell);
|
||||
return;
|
||||
}
|
||||
badlen = (int)curwin->w_cursor.col - (int)VIsual.col;
|
||||
|
Reference in New Issue
Block a user