diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
commit | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch) | |
tree | cd08258054db80bb9a11b1061bb091c70b76926a /test/functional/legacy/edit_spec.lua | |
parent | eaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-aucmd_textputpost.tar.gz rneovim-aucmd_textputpost.tar.bz2 rneovim-aucmd_textputpost.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'test/functional/legacy/edit_spec.lua')
-rw-r--r-- | test/functional/legacy/edit_spec.lua | 66 |
1 files changed, 65 insertions, 1 deletions
diff --git a/test/functional/legacy/edit_spec.lua b/test/functional/legacy/edit_spec.lua index 362d33a0fd..939999e21b 100644 --- a/test/functional/legacy/edit_spec.lua +++ b/test/functional/legacy/edit_spec.lua @@ -43,7 +43,7 @@ describe('edit', function() {0:~ }| {0:~ }| {0:~ }| - {2:-- INSERT -} | + {2:-- INSERT --}| ]]) feed('=') screen:expect([[ @@ -55,4 +55,68 @@ describe('edit', function() =^ | ]]) end) + + -- oldtest: Test_edit_ctrl_r_failed() + it('positioning cursor after CTRL-R expression failed', 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:{}}^ | + ]]) + -- trying to insert a dictionary produces an error + 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(':') + screen:expect([[ + :^ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {3:-- INSERT --} | + ]]) + -- ending Insert mode should put the cursor back on the ':' + feed('<Esc>') + screen:expect([[ + ^: | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]) + end) end) |