Mercurial > vim
diff src/option.c @ 32377:3efec53797f3 v9.0.1520
patch 9.0.1520: completion for option name includes all bool options
Commit: https://github.com/vim/vim/commit/048d9d25214049dfde04c468c14bd1708fb692b8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 6 22:21:11 2023 +0100
patch 9.0.1520: completion for option name includes all bool options
Problem: Completion for option name includes all bool options.
Solution: Do not recognize the "noinv" prefix. Prefix "no" or "inv" when
appropriate.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 06 May 2023 23:30:03 +0200 |
parents | 3d4e28569a6d |
children | bb5458706799 |
line wrap: on
line diff
--- a/src/option.c +++ b/src/option.c @@ -7265,11 +7265,13 @@ set_context_in_set_cmd( if (STRNCMP(p, "no", 2) == 0 && STRNCMP(p, "novice", 6) != 0) { xp->xp_context = EXPAND_BOOL_SETTINGS; + xp->xp_prefix = XP_PREFIX_NO; p += 2; } - if (STRNCMP(p, "inv", 3) == 0) + else if (STRNCMP(p, "inv", 3) == 0) { xp->xp_context = EXPAND_BOOL_SETTINGS; + xp->xp_prefix = XP_PREFIX_INV; p += 3; } xp->xp_pattern = arg = p; @@ -7528,7 +7530,7 @@ ExpandSettings( if (options[opt_idx].var == NULL) continue; if (xp->xp_context == EXPAND_BOOL_SETTINGS - && !(options[opt_idx].flags & P_BOOL)) + && !(options[opt_idx].flags & P_BOOL)) continue; is_term_opt = istermoption_idx(opt_idx); if (is_term_opt && num_normal > 0) @@ -7600,7 +7602,7 @@ ExpandSettings( name_buf[4] = NUL; if (match_str(name_buf, regmatch, *matches, count, - (loop == 0), fuzzy, fuzzystr, fuzmatch)) + (loop == 0), fuzzy, fuzzystr, fuzmatch)) { if (loop == 0) num_term++;