aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/messages_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-06-26 14:50:57 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-08-15 17:58:35 +0800
commit53b0688ac0cad5db4840bbed1d7e5ccac3a1ee42 (patch)
tree81221e4b4bae9c173ef00a4349e52abbe08c440f /test/functional/legacy/messages_spec.lua
parentb47f3131515df91a4438adbc1ed2756a1fc453d7 (diff)
downloadrneovim-53b0688ac0cad5db4840bbed1d7e5ccac3a1ee42.tar.gz
rneovim-53b0688ac0cad5db4840bbed1d7e5ccac3a1ee42.tar.bz2
rneovim-53b0688ac0cad5db4840bbed1d7e5ccac3a1ee42.zip
vim-patch:8.1.1189: mode is not cleared when leaving Insert mode
Problem: Mode is not cleared when leaving Insert mode. Solution: Clear the mode when got_int is set. (Ozaki Kiichi, closes vim/vim#4270) https://github.com/vim/vim/commit/abc7c7fc5a098374f5543a237e6c9dd918848b34
Diffstat (limited to 'test/functional/legacy/messages_spec.lua')
-rw-r--r--test/functional/legacy/messages_spec.lua41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/functional/legacy/messages_spec.lua b/test/functional/legacy/messages_spec.lua
index 51c2406933..f3a742a3e0 100644
--- a/test/functional/legacy/messages_spec.lua
+++ b/test/functional/legacy/messages_spec.lua
@@ -337,6 +337,47 @@ describe('messages', function()
end)
end)
+ describe('mode is cleared when', function()
+ before_each(function()
+ screen = Screen.new(40, 6)
+ screen:set_default_attr_ids({
+ [1] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
+ [2] = {bold = true}, -- ModeMsg
+ [3] = {bold = true, reverse=true}, -- StatusLine
+ })
+ screen:attach()
+ end)
+
+ -- oldtest: Test_mode_message_at_leaving_insert_by_ctrl_c()
+ it('leaving Insert mode with Ctrl-C vim-patch:8.1.1189', function()
+ exec([[
+ func StatusLine() abort
+ return ""
+ endfunc
+ set statusline=%!StatusLine()
+ set laststatus=2
+ ]])
+ feed('i')
+ screen:expect([[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {3: }|
+ {2:-- INSERT --} |
+ ]])
+ feed('<C-C>')
+ screen:expect([[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {3: }|
+ |
+ ]])
+ end)
+ end)
+
-- oldtest: Test_ask_yesno()
it('y/n prompt works', function()
screen = Screen.new(75, 6)