aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/messages_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-06-16 08:01:43 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-06-16 08:55:03 +0800
commitcba07dad494558a4a06e25a35521041864697be3 (patch)
tree525df0a56c87555865dca3735ac1a3dc879efba6 /test/functional/legacy/messages_spec.lua
parentddba917efee26229d77f86d14a9f62dcfdc822b8 (diff)
downloadrneovim-cba07dad494558a4a06e25a35521041864697be3.tar.gz
rneovim-cba07dad494558a4a06e25a35521041864697be3.tar.bz2
rneovim-cba07dad494558a4a06e25a35521041864697be3.zip
vim-patch:9.0.1634: message is cleared when removing mode message
Problem: Message is cleared when removing mode message (Gary Johnson). Solution: Do not clear the command line after displaying a message. https://github.com/vim/vim/commit/800cdbb7caeb5dd4379c6cb071bb12391f20bcf3 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test/functional/legacy/messages_spec.lua')
-rw-r--r--test/functional/legacy/messages_spec.lua48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/functional/legacy/messages_spec.lua b/test/functional/legacy/messages_spec.lua
index 794676153c..0a4d418e9c 100644
--- a/test/functional/legacy/messages_spec.lua
+++ b/test/functional/legacy/messages_spec.lua
@@ -49,6 +49,54 @@ describe('messages', function()
]])
end)
+ -- oldtest: Test_message_not_cleared_after_mode()
+ it('clearing mode does not remove message', function()
+ screen = Screen.new(60, 10)
+ screen:set_default_attr_ids({
+ [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
+ })
+ screen:attach()
+ exec([[
+ 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'])
+ ]])
+
+ feed('gx')
+ screen:expect([[
+ ^one |
+ two |
+ three |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ from DebugSilent normal |
+ ]])
+
+ -- removing the mode message used to also clear the intended message
+ feed('vEgx')
+ screen:expect([[
+ ^one |
+ two |
+ three |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ from DebugSilent visual |
+ ]])
+ end)
+
describe('more prompt', function()
before_each(function()
command('set more')