diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-03-11 20:12:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-11 20:12:58 +0800 |
commit | 8065fc9aaeff734f38109aec52bf852379a5a183 (patch) | |
tree | c8c98e46cb261ce7d065d197c32676ff69ea2296 /test/functional/editor/mode_insert_spec.lua | |
parent | f3efcd0348d34e4ebb44bde3be310379fb84a5a9 (diff) | |
download | rneovim-8065fc9aaeff734f38109aec52bf852379a5a183.tar.gz rneovim-8065fc9aaeff734f38109aec52bf852379a5a183.tar.bz2 rneovim-8065fc9aaeff734f38109aec52bf852379a5a183.zip |
fix(edit): don't subtract msg_scrolled when removing double quote (#22630)
With msg_grid there is no need to subtract msg_scrolled.
Diffstat (limited to 'test/functional/editor/mode_insert_spec.lua')
-rw-r--r-- | test/functional/editor/mode_insert_spec.lua | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/functional/editor/mode_insert_spec.lua b/test/functional/editor/mode_insert_spec.lua index cd51a65be3..b00661ac3a 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,48 @@ 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}, + [1] = {foreground = Screen.colors.Blue}, + [2] = {foreground = Screen.colors.SlateBlue}, + [3] = {bold = true}, + [4] = {reverse = true, bold = true}, + [5] = {background = Screen.colors.Red, foreground = Screen.colors.Red}, + [6] = {background = Screen.colors.Red, foreground = Screen.colors.White}, + [7] = {foreground = Screen.colors.SeaGreen, bold = true}, + }) + screen:attach() + feed('i<C-R>') + screen:expect([[ + {1:^"} | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {3:-- INSERT --} | + ]]) + feed('={}<CR>') + screen:expect([[ + {1:"} | + {0:~ }| + {4: }| + ={5:{}{2:}} | + {6:E731: using Dictionary as a String} | + {7:Press ENTER or type command to continue}^ | + ]]) + feed('<CR>') + screen:expect([[ + ^ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {3:-- INSERT --} | + ]]) + end) end) describe('Ctrl-O', function() |