aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/inccommand_spec.lua
diff options
context:
space:
mode:
authorRob Pilling <robpilling@gmail.com>2019-10-29 22:32:25 +0000
committerRob Pilling <robpilling@gmail.com>2019-10-31 19:22:22 +0000
commitd04ab11f24521e60278a0daed9a7d5abeeaf6f4f (patch)
tree87db42f0c6a51b518ae6e273b95a3a4198ec8a5b /test/functional/ui/inccommand_spec.lua
parentd52d7823898c7fee0121c4d6da730a0530bf8c50 (diff)
downloadrneovim-d04ab11f24521e60278a0daed9a7d5abeeaf6f4f.tar.gz
rneovim-d04ab11f24521e60278a0daed9a7d5abeeaf6f4f.tar.bz2
rneovim-d04ab11f24521e60278a0daed9a7d5abeeaf6f4f.zip
Prevent prompts during inccommand previews
For example, "Backwards range given, OK to swap (y/n)?" on each keypress.
Diffstat (limited to 'test/functional/ui/inccommand_spec.lua')
-rw-r--r--test/functional/ui/inccommand_spec.lua43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index 0d6aa7f128..b841574643 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -2582,6 +2582,49 @@ describe(":substitute", function()
:%s/some\(thing\)\@!/every/^ |
]])
end)
+
+ it("doesn't prompt to swap cmd range", function()
+ screen = Screen.new(50, 8) -- wide to avoid hit-enter prompt
+ common_setup(screen, "split", default_text)
+ feed(':2,1s/tw/MO/g')
+
+ -- substitution preview should have been made, without prompting
+ screen:expect([[
+ {12:MO}o lines |
+ {11:[No Name] [+] }|
+ |2| {12:MO}o lines |
+ {15:~ }|
+ {15:~ }|
+ {15:~ }|
+ {10:[Preview] }|
+ :2,1s/tw/MO/g^ |
+ ]])
+
+ -- but should be prompted on hitting enter
+ feed('<CR>')
+ screen:expect([[
+ {12:MO}o lines |
+ {11:[No Name] [+] }|
+ |2| {12:MO}o lines |
+ {15:~ }|
+ {15:~ }|
+ {15:~ }|
+ {10:[Preview] }|
+ {13:Backwards range given, OK to swap (y/n)?}^ |
+ ]])
+
+ feed('y')
+ screen:expect([[
+ Inc substitution on |
+ ^MOo lines |
+ |
+ {15:~ }|
+ {15:~ }|
+ {15:~ }|
+ {15:~ }|
+ {13:Backwards range given, OK to swap (y/n)?}y |
+ ]])
+ end)
end)
it(':substitute with inccommand during :terminal activity', function()