0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.3377: Vim9: :disass completion does not understand "s:"

Problem:    Vim9: :disass completion does not understand "s:".
Solution:   Expand "s:" to a pattern. (closes #8780)
This commit is contained in:
Bram Moolenaar
2021-08-26 16:39:58 +02:00
parent 4799cef85c
commit 47016f5772
3 changed files with 13 additions and 1 deletions

View File

@@ -2073,7 +2073,9 @@ ExpandFromContext(
// 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)
if ((xp->xp_context == EXPAND_USER_FUNC
|| xp->xp_context == EXPAND_DISASSEMBLE)
&& STRNCMP(pat, "^s:", 3) == 0)
{
int len = (int)STRLEN(pat) + 20;

View File

@@ -751,6 +751,11 @@ func Test_cmdline_complete_expression()
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,6 +838,9 @@ func Test_cmdline_complete_various()
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>", @:)

View File

@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3377,
/**/
3376,
/**/