aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/edit_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
commit931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch)
treed8c1843a95da5ea0bb4acc09f7e37843d9995c86 /test/functional/legacy/edit_spec.lua
parent142d9041391780ac15b89886a54015fdc5c73995 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-931bffbda3668ddc609fc1da8f9eb576b170aa52.tar.gz
rneovim-931bffbda3668ddc609fc1da8f9eb576b170aa52.tar.bz2
rneovim-931bffbda3668ddc609fc1da8f9eb576b170aa52.zip
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to 'test/functional/legacy/edit_spec.lua')
-rw-r--r--test/functional/legacy/edit_spec.lua66
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)