Patch 8.2.3377

7 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 26, 2021, 10:40:38 AM8/26/21
to vim...@googlegroups.com

Patch 8.2.3377
Problem: Vim9: :disass completion does not understand "s:".
Solution: Expand "s:" to a pattern. (closes #8780)
Files: src/cmdexpand.c, src/testdir/test_cmdline.vim


*** ../vim-8.2.3376/src/cmdexpand.c 2021-07-20 17:51:48.239744107 +0200
--- src/cmdexpand.c 2021-08-26 16:38:49.090544474 +0200
***************
*** 2073,2079 ****

// When expanding a function name starting with s:, match the <SNR>nr_
// prefix.
! if (xp->xp_context == EXPAND_USER_FUNC && STRNCMP(pat, "^s:", 3) == 0)
{
int len = (int)STRLEN(pat) + 20;

--- 2073,2081 ----

// When expanding a function name starting with s:, match the <SNR>nr_
// prefix.
! if ((xp->xp_context == EXPAND_USER_FUNC
! || xp->xp_context == EXPAND_DISASSEMBLE)
! && STRNCMP(pat, "^s:", 3) == 0)
{
int len = (int)STRLEN(pat) + 20;

*** ../vim-8.2.3376/src/testdir/test_cmdline.vim 2021-08-21 17:13:08.569405922 +0200
--- src/testdir/test_cmdline.vim 2021-08-26 16:38:14.074616753 +0200
***************
*** 751,756 ****
--- 751,761 ----
unlet g:SomeVar
endfunc

+ " Unique function name for completion below
+ func s:WeirdFunc()
+ echo 'weird'
+ endfunc
+
" Test for various command-line completion
func Test_cmdline_complete_various()
" completion for a command starting with a comment
***************
*** 833,838 ****
--- 838,846 ----
call feedkeys(":disas profile Test_cmdline_complete_var\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal("\"disas profile Test_cmdline_complete_various", @:)

+ call feedkeys(":disas s:WeirdF\<C-A>\<C-B>\"\<CR>", 'xt')
+ call assert_match('"disas <SNR>\d\+_WeirdFunc()', @:)
+
" completion for the :match command
call feedkeys(":match Search /pat/\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal("\"match Search /pat/\<C-A>", @:)
*** ../vim-8.2.3376/src/version.c 2021-08-25 22:37:33.107295294 +0200
--- src/version.c 2021-08-26 16:34:25.675085091 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3377,
/**/

--
./configure
Checking whether build environment is sane ...
build environment is grinning and holding a spatula. Guess not.

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