mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +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:
@@ -1400,11 +1400,11 @@ int utf_fold(int a)
|
||||
int mb_toupper(int a)
|
||||
{
|
||||
// If 'casemap' contains "keepascii" use ASCII style toupper().
|
||||
if (a < 128 && (cmp_flags & CMP_KEEPASCII)) {
|
||||
if (a < 128 && (cmp_flags & kOptCmpFlagKeepascii)) {
|
||||
return TOUPPER_ASC(a);
|
||||
}
|
||||
|
||||
if (!(cmp_flags & CMP_INTERNAL)) {
|
||||
if (!(cmp_flags & kOptCmpFlagInternal)) {
|
||||
return (int)towupper((wint_t)a);
|
||||
}
|
||||
|
||||
@@ -1426,11 +1426,11 @@ bool mb_islower(int a)
|
||||
int mb_tolower(int a)
|
||||
{
|
||||
// If 'casemap' contains "keepascii" use ASCII style tolower().
|
||||
if (a < 128 && (cmp_flags & CMP_KEEPASCII)) {
|
||||
if (a < 128 && (cmp_flags & kOptCmpFlagKeepascii)) {
|
||||
return TOLOWER_ASC(a);
|
||||
}
|
||||
|
||||
if (!(cmp_flags & CMP_INTERNAL)) {
|
||||
if (!(cmp_flags & kOptCmpFlagInternal)) {
|
||||
return (int)towlower((wint_t)a);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user