mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
vim-patch:9.0.2154: The option[] array is not sorted (#26475)
Problem: The options[] array is not sorted alphabetically.
Solution: Sort it alphabetically. Add a test. Avoid unnecessary loop
iterations in findoption().
closes: vim/vim#13648
Cherry-pick Test_set_one_column() change from patch 8.2.0432.
f48558e10a
This commit is contained in:
@@ -3065,11 +3065,14 @@ int findoption_len(const char *const arg, const size_t len)
|
||||
opt_idx = quick_tab[CHAR_ORD_LOW(arg[0])];
|
||||
}
|
||||
// Match full name
|
||||
for (; (s = options[opt_idx].fullname) != NULL; opt_idx++) {
|
||||
for (; (s = options[opt_idx].fullname) != NULL && s[0] == arg[0]; opt_idx++) {
|
||||
if (strncmp(arg, s, len) == 0 && s[len] == NUL) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (s != NULL && s[0] != arg[0]) {
|
||||
s = NULL;
|
||||
}
|
||||
if (s == NULL && !is_term_opt) {
|
||||
opt_idx = quick_tab[CHAR_ORD_LOW(arg[0])];
|
||||
// Match short name
|
||||
|
Reference in New Issue
Block a user