Skip to content

Commit dfe04db

Browse files
obcatbrammool
authored andcommitted
patch 8.2.3431: completion for :disas sorts local functions first
Problem: Completion for :disas sorts local functions first. Solution: Sort local functions last, like with :delfunc. (Naohiro Ono, closes #8860)
1 parent f1e8876 commit dfe04db

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/cmdexpand.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,8 @@ ExpandGeneric(
22622262
{
22632263
if (xp->xp_context == EXPAND_EXPRESSION
22642264
|| xp->xp_context == EXPAND_FUNCTIONS
2265-
|| xp->xp_context == EXPAND_USER_FUNC)
2265+
|| xp->xp_context == EXPAND_USER_FUNC
2266+
|| xp->xp_context == EXPAND_DISASSEMBLE)
22662267
// <SNR> functions should be sorted to the end.
22672268
qsort((void *)*file, (size_t)*num_file, sizeof(char_u *),
22682269
sort_func_compare);

src/testdir/test_cmdline.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,11 @@ func Test_cmdline_complete_various()
854854
call feedkeys(":disas s:WeirdF\<C-A>\<C-B>\"\<CR>", 'xt')
855855
call assert_match('"disas <SNR>\d\+_WeirdFunc', @:)
856856

857+
call feedkeys(":disas \<S-Tab>\<C-B>\"\<CR>", 'xt')
858+
call assert_match('"disas <SNR>\d\+_', @:)
859+
call feedkeys(":disas debug \<S-Tab>\<C-B>\"\<CR>", 'xt')
860+
call assert_match('"disas debug <SNR>\d\+_', @:)
861+
857862
" completion for the :match command
858863
call feedkeys(":match Search /pat/\<C-A>\<C-B>\"\<CR>", 'xt')
859864
call assert_equal("\"match Search /pat/\<C-A>", @:)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3431,
758760
/**/
759761
3430,
760762
/**/

0 commit comments

Comments
 (0)