Patch 8.2.4478
Problem:    Crash when using fuzzy completion.
Solution:   Temporary fix: put back regexp. (closes #9852, closes #9851)
Files:      src/cmdexpand.c, src/testdir/test_cmdline.vim


*** ../vim-8.2.4477/src/cmdexpand.c     2022-02-26 15:52:04.744494083 +0000
--- src/cmdexpand.c     2022-02-26 16:04:46.602454694 +0000
***************
*** 2496,2501 ****
--- 2496,2503 ----
      int               ret;
      int               flags;
      char_u    *tofree = NULL;
+     int               fuzzy = cmdline_fuzzy_complete(pat)
+                                    && cmdline_fuzzy_completion_supported(xp);
  
      flags = map_wildopts_to_ewflags(options);
  
***************
*** 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)
--- 2582,2596 ----
        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)
***************
*** 2599,2605 ****
      else
        ret = ExpandOther(pat, xp, &regmatch, matches, numMatches);
  
!     vim_regfree(regmatch.regprog);
      vim_free(tofree);
  
      return ret;
--- 2604,2611 ----
      else
        ret = ExpandOther(pat, xp, &regmatch, matches, numMatches);
  
!     if (!fuzzy)
!       vim_regfree(regmatch.regprog);
      vim_free(tofree);
  
      return ret;
*** ../vim-8.2.4477/src/testdir/test_cmdline.vim        2022-02-26 
11:04:39.090453026 +0000
--- src/testdir/test_cmdline.vim        2022-02-26 15:59:48.375424859 +0000
***************
*** 2659,2664 ****
--- 2659,2668 ----
    call assert_equal('"mapclear <buffer>', @:)
  
    " map name fuzzy completion - NOT supported
+   " test regex completion works
+   set wildoptions=fuzzy
+   call feedkeys(":cnoremap <ex\<Tab> <esc> \<Tab>\<C-B>\"\<CR>", 'tx')
+   call assert_equal("\"cnoremap <expr> <esc> \<Tab>", @:)
  
    " menu name fuzzy completion
    if has('gui_running')
*** ../vim-8.2.4477/src/version.c       2022-02-26 15:52:04.744494083 +0000
--- src/version.c       2022-02-26 16:04:22.606522969 +0000
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     4478,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
112. You are amazed that anyone uses a phone without data...let
     alone hear actual voices.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220226160657.7C73F1C1149%40moolenaar.net.

Raspunde prin e-mail lui