summaryrefslogtreecommitdiffstats
path: root/src/cmdexpand.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-05-06 22:21:11 +0100
committerBram Moolenaar <Bram@vim.org>2023-05-06 22:21:11 +0100
commit048d9d25214049dfde04c468c14bd1708fb692b8 (patch)
tree5e902e2b54814aa8df9c582b73eb564e0b28d5c0 /src/cmdexpand.c
parent0b70aeb49d6dfd1879162f202150cb1ed5f024ad (diff)
patch 9.0.1520: completion for option name includes all bool optionsv9.0.1520
Problem: Completion for option name includes all bool options. Solution: Do not recognize the "noinv" prefix. Prefix "no" or "inv" when appropriate.
Diffstat (limited to 'src/cmdexpand.c')
-rw-r--r--src/cmdexpand.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index b5a7a3eb29..4ef9c31121 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -1012,14 +1012,31 @@ ExpandOne(
{
len = 0;
for (i = 0; i < xp->xp_numfiles; ++i)
+ {
+ if (i > 0)
+ {
+ if (xp->xp_prefix == XP_PREFIX_NO)
+ len += 2; // prefix "no"
+ else if (xp->xp_prefix == XP_PREFIX_INV)
+ len += 3; // prefix "inv"
+ }
len += (long_u)STRLEN(xp->xp_files[i]) + 1;
+ }
ss = alloc(len);
if (ss != NULL)
{
*ss = NUL;
for (i = 0; i < xp->xp_numfiles; ++i)
{
+ if (i > 0)
+ {
+ if (xp->xp_prefix == XP_PREFIX_NO)
+ STRCAT(ss, "no");
+ else if (xp->xp_prefix == XP_PREFIX_INV)
+ STRCAT(ss, "inv");
+ }
STRCAT(ss, xp->xp_files[i]);
+
if (i != xp->xp_numfiles - 1)
STRCAT(ss, (options & WILD_USE_NL) ? "\n" : " ");
}
@@ -1044,6 +1061,7 @@ ExpandInit(expand_T *xp)
{
CLEAR_POINTER(xp);
xp->xp_backslash = XP_BS_NONE;
+ xp->xp_prefix = XP_PREFIX_NONE;
xp->xp_numfiles = -1;
}