// 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;
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
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>", @:)