Patch 8.2.4477

8 views
Skip to first unread message

Bram Moolenaar

unread,
Feb 26, 2022, 10:53:35 AM2/26/22
to vim...@googlegroups.com

Patch 8.2.4477
Problem: Crash when using fuzzy completion.
Solution: Temporary fix: put back regexp. (closes #9851)
Files: src/cmdexpand.c


*** ../vim-8.2.4476/src/cmdexpand.c 2022-02-26 11:04:39.090453026 +0000
--- src/cmdexpand.c 2022-02-26 15:11:27.222716003 +0000
***************
*** 2370,2376 ****
static int
ExpandOther(
char_u *pat,
! expand_T *xp,
regmatch_T *rmp,
char_u ***matches,
int *numMatches)
--- 2370,2376 ----
static int
ExpandOther(
char_u *pat,
! expand_T *xp,
regmatch_T *rmp,
char_u ***matches,
int *numMatches)
***************
*** 2496,2502 ****
int ret;
int flags;
char_u *tofree = NULL;
- int fuzzy = cmdline_fuzzy_complete(pat);

flags = map_wildopts_to_ewflags(options);

--- 2496,2501 ----
***************
*** 2581,2595 ****
pat = tofree;
}

! if (!fuzzy)
! {
! 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);
! }

if (xp->xp_context == EXPAND_SETTINGS
|| xp->xp_context == EXPAND_BOOL_SETTINGS)
--- 2580,2591 ----
pat = tofree;
}

! 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);

if (xp->xp_context == EXPAND_SETTINGS
|| xp->xp_context == EXPAND_BOOL_SETTINGS)
***************
*** 2603,2610 ****
else
ret = ExpandOther(pat, xp, &regmatch, matches, numMatches);

! if (!fuzzy)
! vim_regfree(regmatch.regprog);
vim_free(tofree);

return ret;
--- 2599,2605 ----
else
ret = ExpandOther(pat, xp, &regmatch, matches, numMatches);

! vim_regfree(regmatch.regprog);
vim_free(tofree);

return ret;
*** ../vim-8.2.4476/src/version.c 2022-02-26 11:46:09.510212631 +0000
--- src/version.c 2022-02-26 15:51:38.764519836 +0000
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 4477,
/**/

--
hundred-and-one symptoms of being an internet addict:
111. You and your friends get together regularly on IRC, even though
all of you live in the same street.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages