summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-06-15 16:40:02 +0100
committerBram Moolenaar <Bram@vim.org>2023-06-15 16:40:02 +0100
commit800cdbb7caeb5dd4379c6cb071bb12391f20bcf3 (patch)
tree8a172c31c31f64f37e2ed96ae819d40e00901f45 /src/testdir
parent19dfa276c37dcf657922c6f9b48cf2954191e8b6 (diff)
patch 9.0.1634: message is cleared when removing mode messagev9.0.1634
Problem: Message is cleared when removing mode message (Gary Johnson). Solution: Do not clear the command line after displaying a message.
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/dumps/Test_message_not_cleared_after_mode_1.dump10
-rw-r--r--src/testdir/dumps/Test_message_not_cleared_after_mode_2.dump10
-rw-r--r--src/testdir/test_messages.vim28
3 files changed, 48 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_message_not_cleared_after_mode_1.dump b/src/testdir/dumps/Test_message_not_cleared_after_mode_1.dump
new file mode 100644
index 0000000000..9e8d20ac4d
--- /dev/null
+++ b/src/testdir/dumps/Test_message_not_cleared_after_mode_1.dump
@@ -0,0 +1,10 @@
+>o+0&#ffffff0|n|e| @71
+|t|w|o| @71
+|t|h|r|e@1| @69
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|f+0#0000000&|r|o|m| |D|e|b|u|g|S|i|l|e|n|t| |n|o|r|m|a|l| @33|1|,|1| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_message_not_cleared_after_mode_2.dump b/src/testdir/dumps/Test_message_not_cleared_after_mode_2.dump
new file mode 100644
index 0000000000..49dabef4f6
--- /dev/null
+++ b/src/testdir/dumps/Test_message_not_cleared_after_mode_2.dump
@@ -0,0 +1,10 @@
+>o+0&#ffffff0|n|e| @71
+|t|w|o| @71
+|t|h|r|e@1| @69
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|f+0#0000000&|r|o|m| |D|e|b|u|g|S|i|l|e|n|t| |v|i|s|u|a|l| @33|1|,|1| @10|A|l@1|
diff --git a/src/testdir/test_messages.vim b/src/testdir/test_messages.vim
index ff705fe85f..0647afd287 100644
--- a/src/testdir/test_messages.vim
+++ b/src/testdir/test_messages.vim
@@ -336,6 +336,34 @@ func Test_message_more_scrollback()
call StopVimInTerminal(buf)
endfunc
+func Test_message_not_cleared_after_mode()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ nmap <silent> gx :call DebugSilent('normal')<CR>
+ vmap <silent> gx :call DebugSilent('visual')<CR>
+ function DebugSilent(arg)
+ echomsg "from DebugSilent" a:arg
+ endfunction
+ set showmode
+ set cmdheight=1
+ call setline(1, ['one', 'two', 'three'])
+ END
+ call writefile(lines, 'XmessageMode', 'D')
+ let buf = RunVimInTerminal('-S XmessageMode', {'rows': 10})
+
+ call term_sendkeys(buf, 'gx')
+ call TermWait(buf)
+ call VerifyScreenDump(buf, 'Test_message_not_cleared_after_mode_1', {})
+
+ " removing the mode message used to also clear the intended message
+ call term_sendkeys(buf, 'vEgx')
+ call TermWait(buf)
+ call VerifyScreenDump(buf, 'Test_message_not_cleared_after_mode_2', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
" Test verbose message before echo command
func Test_echo_verbose_system()
CheckRunVimInTerminal