patch 9.1.0748: :keep* commmands are sometimes misidentified as :k
Problem: The :keep{alt,jumps,marks,patterns} commmands are sometimes
misidentified as :k.
Solution: Make sure one_letter_cmd() only returns true for :k and not
other :keep* commands (Doug Kearns).
This currently manifests as missing completion for :keep* commands and
incorrect results from fullcommand().
E.g., fullcommand("keepmarks") returns "k" rather than "keepmarks".
The correct command, however, is executed as command modifiers are
handled specially in do_one_cmd() rather than using find_ex_command().
Fix exists(':k') so that it returns 2 for a full match.
closes: #15742
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_exists.vim b/src/testdir/test_exists.vim
index 9cdb3fb..404b15c 100644
--- a/src/testdir/test_exists.vim
+++ b/src/testdir/test_exists.vim
@@ -113,6 +113,13 @@
" Internal command with a count
call assert_equal(0, exists(':3buffer'))
+ " Valid internal command (full match)
+ call assert_equal(2, exists(':k'))
+ " Non-existing internal command (':k' with arg 'e')
+ call assert_equal(0, exists(':ke'))
+ " Valid internal command (partial match)
+ call assert_equal(1, exists(':kee'))
+
" User defined command (full match)
command! MyCmd :echo 'My command'
call assert_equal(2, exists(':MyCmd'))