patch 9.1.0683: mode() returns wrong value with <Cmd> mapping
Problem: mode() returns wrong value with <Cmd> mapping
Solution: Change decision priority of VIsual_active and move
visual mode a bit further down (kuuote)
closes: #15533
Signed-off-by: kuuote <znmxodq1@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index 8e973f6..1021d05 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -923,6 +923,10 @@
call feedkeys("gQ\<Insert>\<F2>vi\<CR>", 'xt')
call assert_equal("c-cvr", g:current_modes)
+ " Commandline mode in Visual mode should return "c-c", never "v-v".
+ call feedkeys("v\<Cmd>call input('')\<CR>\<F2>\<CR>\<Esc>", 'xt')
+ call assert_equal("c-c", g:current_modes)
+
" Executing commands in Vim Ex mode should return "cv", never "cvr",
" as Cmdline editing has already ended.
call feedkeys("gQcall Save_mode()\<CR>vi\<CR>", 'xt')