]> granicus.if.org Git - vim/commitdiff
patch 8.2.3431: completion for :disas sorts local functions first v8.2.3431
authornaohiro ono <obcat@icloud.com>
Sun, 12 Sep 2021 13:45:10 +0000 (15:45 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 12 Sep 2021 13:45:10 +0000 (15:45 +0200)
Problem:    Completion for :disas sorts local functions first.
Solution:   Sort local functions last, like with :delfunc. (Naohiro Ono,
            closes #8860)

src/cmdexpand.c
src/testdir/test_cmdline.vim
src/version.c

index 6c92957692bce2f05f91fce6462c8444fa0a5e61..c36c21a3d854a12471f58f8ccc191459d04b12ea 100644 (file)
@@ -2262,7 +2262,8 @@ ExpandGeneric(
     {
        if (xp->xp_context == EXPAND_EXPRESSION
                || xp->xp_context == EXPAND_FUNCTIONS
-               || xp->xp_context == EXPAND_USER_FUNC)
+               || xp->xp_context == EXPAND_USER_FUNC
+               || xp->xp_context == EXPAND_DISASSEMBLE)
            // <SNR> functions should be sorted to the end.
            qsort((void *)*file, (size_t)*num_file, sizeof(char_u *),
                                                           sort_func_compare);
index 15ec7d8a35944bab85b61c0fd1ee5b681411c12f..a0f3ffda42ed38803b23e814674106b052f83675 100644 (file)
@@ -854,6 +854,11 @@ func Test_cmdline_complete_various()
   call feedkeys(":disas s:WeirdF\<C-A>\<C-B>\"\<CR>", 'xt')
   call assert_match('"disas <SNR>\d\+_WeirdFunc', @:)
 
+  call feedkeys(":disas \<S-Tab>\<C-B>\"\<CR>", 'xt')
+  call assert_match('"disas <SNR>\d\+_', @:)
+  call feedkeys(":disas debug \<S-Tab>\<C-B>\"\<CR>", 'xt')
+  call assert_match('"disas debug <SNR>\d\+_', @:)
+
   " completion for the :match command
   call feedkeys(":match Search /pat/\<C-A>\<C-B>\"\<CR>", 'xt')
   call assert_equal("\"match Search /pat/\<C-A>", @:)
index fe111e59361e5a5d94edd426201dda132d028939..053648a5586653251fa9a4b92a917423ff6e4e62 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3431,
 /**/
     3430,
 /**/