aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor/mode_insert_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/editor/mode_insert_spec.lua')
-rw-r--r--test/functional/editor/mode_insert_spec.lua85
1 files changed, 85 insertions, 0 deletions
diff --git a/test/functional/editor/mode_insert_spec.lua b/test/functional/editor/mode_insert_spec.lua
index cd51a65be3..37651164f5 100644
--- a/test/functional/editor/mode_insert_spec.lua
+++ b/test/functional/editor/mode_insert_spec.lua
@@ -1,6 +1,7 @@
-- Insert-mode tests.
local helpers = require('test.functional.helpers')(after_each)
+local Screen = require('test.functional.ui.screen')
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local expect = helpers.expect
local command = helpers.command
@@ -48,6 +49,56 @@ describe('insert-mode', function()
feed('i<C-r>"')
expect('påskägg')
end)
+
+ it('double quote is removed after hit-enter prompt #22609', function()
+ local screen = Screen.new(60, 6)
+ screen:set_default_attr_ids({
+ [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
+ [1] = {foreground = Screen.colors.Blue}, -- SpecialKey
+ [2] = {foreground = Screen.colors.SlateBlue},
+ [3] = {bold = true}, -- ModeMsg
+ [4] = {reverse = true, bold = true}, -- MsgSeparator
+ [5] = {background = Screen.colors.Red, foreground = Screen.colors.White}, -- ErrorMsg
+ [6] = {foreground = Screen.colors.SeaGreen, bold = true}, -- MoreMsg
+ })
+ screen:attach()
+ feed('i<C-R>')
+ screen:expect([[
+ {1:^"} |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {3:-- INSERT --} |
+ ]])
+ feed('={}')
+ screen:expect([[
+ {1:"} |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ ={2:{}}^ |
+ ]])
+ feed('<CR>')
+ screen:expect([[
+ {1:"} |
+ {0:~ }|
+ {4: }|
+ ={2:{}} |
+ {5:E731: Using a Dictionary as a String} |
+ {6:Press ENTER or type command to continue}^ |
+ ]])
+ feed('<CR>')
+ screen:expect([[
+ ^ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {3:-- INSERT --} |
+ ]])
+ end)
end)
describe('Ctrl-O', function()
@@ -141,4 +192,38 @@ describe('insert-mode', function()
feed('i<C-S-V><C-J><C-S-V><C-@><C-S-V><C-[><C-S-V><C-S-M><C-S-V><M-C-I><C-S-V><C-D-J><Esc>')
expect('<C-J><C-@><C-[><C-S-M><M-C-I><C-D-J>')
end)
+
+ it('multi-char mapping updates screen properly #25626', function()
+ local screen = Screen.new(60, 6)
+ screen:set_default_attr_ids({
+ [0] = {bold = true, foreground = Screen.colors.Blue}; -- NonText
+ [1] = {bold = true, reverse = true}; -- StatusLine
+ [2] = {reverse = true}; -- StatusLineNC
+ [3] = {bold = true}; -- ModeMsg
+ })
+ screen:attach()
+ command('vnew')
+ insert('foo\nfoo\nfoo')
+ command('wincmd w')
+ command('set timeoutlen=10000')
+ command('inoremap jk <Esc>')
+ feed('i<CR>βββ<Left><Left>j')
+ screen:expect{grid=[[
+ foo │ |
+ foo │β^jβ |
+ foo │{0:~ }|
+ {0:~ }│{0:~ }|
+ {2:[No Name] [+] }{1:[No Name] [+] }|
+ {3:-- INSERT --} |
+ ]]}
+ feed('k')
+ screen:expect{grid=[[
+ foo │ |
+ foo │^βββ |
+ foo │{0:~ }|
+ {0:~ }│{0:~ }|
+ {2:[No Name] [+] }{1:[No Name] [+] }|
+ |
+ ]]}
+ end)
end)