summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-02-26 15:52:08 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-26 15:52:08 +0000
commit29ab6ce9f36660cffaad3c8789e71162e5db5d2f (patch)
treec87861f2c117ef33e844accd54eb9a42b79ce560
parentc51cf0329809c7ae946c59d6f56699227efc9d1b (diff)
downloadvim-git-29ab6ce9f36660cffaad3c8789e71162e5db5d2f.tar.gz
patch 8.2.4477: crash when using fuzzy completionv8.2.4477
Problem: Crash when using fuzzy completion. Solution: Temporary fix: put back regexp. (closes #9851)
-rw-r--r--src/cmdexpand.c19
-rw-r--r--src/version.c2
2 files changed, 9 insertions, 12 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 138ff9ef8..dd8bc06d0 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -2370,7 +2370,7 @@ get_mapclear_arg(expand_T *xp UNUSED, int idx)
static int
ExpandOther(
char_u *pat,
- expand_T *xp,
+ expand_T *xp,
regmatch_T *rmp,
char_u ***matches,
int *numMatches)
@@ -2496,7 +2496,6 @@ ExpandFromContext(
int ret;
int flags;
char_u *tofree = NULL;
- int fuzzy = cmdline_fuzzy_complete(pat);
flags = map_wildopts_to_ewflags(options);
@@ -2581,15 +2580,12 @@ ExpandFromContext(
pat = tofree;
}
- if (!fuzzy)
- {
- regmatch.regprog = vim_regcomp(pat, magic_isset() ? RE_MAGIC : 0);
- if (regmatch.regprog == NULL)
- return FAIL;
+ regmatch.regprog = vim_regcomp(pat, magic_isset() ? RE_MAGIC : 0);
+ if (regmatch.regprog == NULL)
+ return FAIL;
- // set ignore-case according to p_ic, p_scs and pat
- regmatch.rm_ic = ignorecase(pat);
- }
+ // set ignore-case according to p_ic, p_scs and pat
+ regmatch.rm_ic = ignorecase(pat);
if (xp->xp_context == EXPAND_SETTINGS
|| xp->xp_context == EXPAND_BOOL_SETTINGS)
@@ -2603,8 +2599,7 @@ ExpandFromContext(
else
ret = ExpandOther(pat, xp, &regmatch, matches, numMatches);
- if (!fuzzy)
- vim_regfree(regmatch.regprog);
+ vim_regfree(regmatch.regprog);
vim_free(tofree);
return ret;
diff --git a/src/version.c b/src/version.c
index 2fa8e72f1..c8511d2b4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4477,
+/**/
4476,
/**/
4475,