forked from aniani/vim
patch 9.1.0624: ex command modifiers not found
Problem: ex command modifiers are not found
(Ingo Karkat, after v9.1.0352)
Solution: partly revert patch v9.1.0352, ignore :{ and :}
when expanding ex commands
The issue is, that the :keepmarks command can be abbreviated to :kee or
:keep or :keepm but not to e.g. :ke (because that would be the :exe
command :k with register e).
This basically means, we need `:kee` sorted before `:keepalt` but at the
same time `:keepmarks` sorted after the `:keepalt` command in the
cmdmod_info_tab table. Due to this, the binary search may not work
correctly, so let's revert that part of patch v9.1.0352.
fixes: #15305
closes: #15336
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -3870,4 +3870,25 @@ func Test_term_option()
|
||||
let &cpo = _cpo
|
||||
endfunc
|
||||
|
||||
func Test_ex_command_completion()
|
||||
" required for :*
|
||||
set cpo+=*
|
||||
let list = filter(getcompletion('', 'command'), 'exists(":" . v:val) == 0')
|
||||
" :++ and :-- are only valid in Vim9 Script context, so they can be ignored
|
||||
call assert_equal(['++', '--'], sort(list))
|
||||
call assert_equal(1, exists(':k'))
|
||||
call assert_equal(0, exists(':ke'))
|
||||
call assert_equal(1, exists(':kee'))
|
||||
call assert_equal(1, exists(':keep'))
|
||||
call assert_equal(1, exists(':keepm'))
|
||||
call assert_equal(1, exists(':keepma'))
|
||||
call assert_equal(1, exists(':keepmar'))
|
||||
call assert_equal(1, exists(':keepmark'))
|
||||
call assert_equal(2, exists(':keepmarks'))
|
||||
call assert_equal(2, exists(':keepalt'))
|
||||
call assert_equal(2, exists(':keepjumps'))
|
||||
call assert_equal(2, exists(':keeppatterns'))
|
||||
set cpo-=*
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
Reference in New Issue
Block a user