diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 21:52:58 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 21:52:58 +0000 |
commit | 931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch) | |
tree | d8c1843a95da5ea0bb4acc09f7e37843d9995c86 /test/functional/editor/mode_insert_spec.lua | |
parent | 142d9041391780ac15b89886a54015fdc5c73995 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-userreg.tar.gz rneovim-userreg.tar.bz2 rneovim-userreg.zip |
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to 'test/functional/editor/mode_insert_spec.lua')
-rw-r--r-- | test/functional/editor/mode_insert_spec.lua | 85 |
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) |