Patch 8.2.4608

8 views
Skip to first unread message

Bram Moolenaar

unread,
Mar 22, 2022, 12:08:00 PM3/22/22
to vim...@googlegroups.com

Patch 8.2.4608
Problem: getcompletion() does not work properly when 'wildoptions
contains "fuzzy".
Solution: Do not use addstar(). (Yegappan Lakshmanan, closes #9992,
closes #9986)
Files: runtime/doc/builtin.txt, src/cmdexpand.c,
src/testdir/test_cmdline.vim


*** ../vim-8.2.4607/runtime/doc/builtin.txt 2022-03-14 19:24:41.863926393 +0000
--- runtime/doc/builtin.txt 2022-03-22 15:59:42.298882555 +0000
***************
*** 3263,3268 ****
--- 3273,3282 ----
is applied to filter the results. Otherwise all the matches
are returned. The 'wildignorecase' option always applies.

+ If the 'wildoptions' option contains 'fuzzy', then fuzzy
+ matching is used to get the completion matches. Otherwise
+ regular expression matching is used.
+
If {type} is "cmdline", then the |cmdline-completion| result is
returned. For example, to complete the possible values after
a ":call" command: >
*** ../vim-8.2.4607/src/cmdexpand.c 2022-03-16 13:33:22.074467978 +0000
--- src/cmdexpand.c 2022-03-22 15:59:42.298882555 +0000
***************
*** 3707,3713 ****
# endif
}

! pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
if ((rettv_list_alloc(rettv) != FAIL) && (pat != NULL))
{
int i;
--- 3707,3718 ----
# endif
}

! if (cmdline_fuzzy_completion_supported(&xpc))
! // when fuzzy matching, don't modify the search string
! pat = vim_strsave(xpc.xp_pattern);
! else
! pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
!
if ((rettv_list_alloc(rettv) != FAIL) && (pat != NULL))
{
int i;
*** ../vim-8.2.4607/src/testdir/test_cmdline.vim 2022-03-17 13:03:05.967464752 +0000
--- src/testdir/test_cmdline.vim 2022-03-22 15:59:42.298882555 +0000
***************
*** 552,557 ****
--- 552,573 ----
call assert_fails('call getcompletion("abc", [])', 'E475:')
endfunc

+ " Test for getcompletion() with "fuzzy" in 'wildoptions'
+ func Test_getcompletion_wildoptions()
+ let save_wildoptions = &wildoptions
+ set wildoptions&
+ let l = getcompletion('space', 'option')
+ call assert_equal([], l)
+ let l = getcompletion('ier', 'command')
+ call assert_equal([], l)
+ set wildoptions=fuzzy
+ let l = getcompletion('space', 'option')
+ call assert_true(index(l, 'backspace') >= 0)
+ let l = getcompletion('ier', 'command')
+ call assert_true(index(l, 'compiler') >= 0)
+ let &wildoptions = save_wildoptions
+ endfunc
+
func Test_complete_autoload_error()
let save_rtp = &rtp
let lines =<< trim END
*** ../vim-8.2.4607/src/version.c 2022-03-22 12:13:49.151376708 +0000
--- src/version.c 2022-03-22 16:05:11.362284708 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4608,
/**/

--
Apologies for taking up the bandwidth with the apology. Anything else I
can apologise for ...... er no can't think of anything, sorry about that.
Andy Hunt (Member of British Olympic Apology Squad)

/// 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 ///

Bram Moolenaar

unread,
Mar 22, 2022, 2:13:42 PM3/22/22
to vim...@googlegroups.com, Bram Moolenaar

I wrote:

> Patch 8.2.4608
> Problem: getcompletion() does not work properly when 'wildoptions
> contains "fuzzy".
> Solution: Do not use addstar(). (Yegappan Lakshmanan, closes #9992,
> closes #9986)
> Files: runtime/doc/builtin.txt, src/cmdexpand.c,
> src/testdir/test_cmdline.vim

Pushing to github is failing:

Enumerating objects: 19, done.
Counting objects: 100% (19/19), done.
Delta compression using up to 16 threads
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 1.29 KiB | 109.00 KiB/s, done.
Total 10 (delta 9), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (9/9), completed with 9 local objects.
remote: Internal Server Error
To github.com:vim/vim.git
! [remote rejected] master -> master (Internal Server Error)
error: failed to push some refs to 'github.com:vim/vim.git'


--
Why doesn't Tarzan have a beard?

Bram Moolenaar

unread,
Mar 22, 2022, 3:50:07 PM3/22/22
to Bram Moolenaar, vim...@googlegroups.com

I wrote:

> > Patch 8.2.4608
> > Problem: getcompletion() does not work properly when 'wildoptions
> > contains "fuzzy".
> > Solution: Do not use addstar(). (Yegappan Lakshmanan, closes #9992,
> > closes #9986)
> > Files: runtime/doc/builtin.txt, src/cmdexpand.c,
> > src/testdir/test_cmdline.vim
>
> Pushing to github is failing:
>
> Enumerating objects: 19, done.
> Counting objects: 100% (19/19), done.
> Delta compression using up to 16 threads
> Compressing objects: 100% (10/10), done.
> Writing objects: 100% (10/10), 1.29 KiB | 109.00 KiB/s, done.
> Total 10 (delta 9), reused 0 (delta 0), pack-reused 0
> remote: Resolving deltas: 100% (9/9), completed with 9 local objects.
> remote: Internal Server Error
> To github.com:vim/vim.git
> ! [remote rejected] master -> master (Internal Server Error)
> error: failed to push some refs to 'github.com:vim/vim.git'

Looks like the problem has been fixed.

--
PRINCE: He's come to rescue me, father.
LAUNCELOT: (embarrassed) Well, let's not jump to conclusions ...
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Reply all
Reply to author
Forward
0 new messages