# HG changeset patch # User Bram Moolenaar # Date 1629989104 -7200 # Node ID 17ba70005a2e7bcf73e909ecba1e2855c659156e # Parent 17194bce690e1ce1bdf600e6d5541718ca0bbf7d patch 8.2.3377: Vim9: :disass completion does not understand "s:" Commit: https://github.com/vim/vim/commit/47016f57724d3970c54f4ca1f392dff39d3fecae Author: Bram Moolenaar Date: Thu Aug 26 16:39:58 2021 +0200 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 https://github.com/vim/vim/issues/8780) diff --git a/src/cmdexpand.c b/src/cmdexpand.c --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -2073,7 +2073,9 @@ ExpandFromContext( // When expanding a function name starting with s:, match the 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; diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -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\\\"\", 'xt') call assert_equal("\"disas profile Test_cmdline_complete_various", @:) + call feedkeys(":disas s:WeirdF\\\"\", 'xt') + call assert_match('"disas \d\+_WeirdFunc()', @:) + " completion for the :match command call feedkeys(":match Search /pat/\\\"\", 'xt') call assert_equal("\"match Search /pat/\", @:) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -756,6 +756,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3377, +/**/ 3376, /**/ 3375,