aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRob Pilling <robpilling@gmail.com>2019-10-29 22:31:40 +0000
committerRob Pilling <robpilling@gmail.com>2019-10-31 19:16:52 +0000
commitd52d7823898c7fee0121c4d6da730a0530bf8c50 (patch)
tree2ab1b07cda5b9a91123e5352786985b0d9fe242e /test
parent1f6ce1f97d60f9fd1cc75dab4b604a72d390bf1e (diff)
downloadrneovim-d52d7823898c7fee0121c4d6da730a0530bf8c50.tar.gz
rneovim-d52d7823898c7fee0121c4d6da730a0530bf8c50.tar.bz2
rneovim-d52d7823898c7fee0121c4d6da730a0530bf8c50.zip
Prevent :topleft, etc modifying the inccommand preview window
Diffstat (limited to 'test')
-rw-r--r--test/functional/ui/inccommand_spec.lua48
1 files changed, 47 insertions, 1 deletions
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index c5ad093eca..0d6aa7f128 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -95,7 +95,7 @@ local function common_setup(screen, inccommand, text)
end
end
-describe(":substitute, inccommand=split", function()
+describe(":substitute, inccommand=split interactivity", function()
before_each(function()
clear()
common_setup(nil, "split", default_text)
@@ -788,6 +788,52 @@ describe(":substitute, inccommand=split", function()
screen:expect{any=[[two lines]]}
end)
+ it("ignores new-window modifiers when splitting the preview window", function()
+ -- one modifier
+ feed(':topleft %s/tw/to')
+ screen:expect([[
+ Inc substitution on |
+ {12:to}o lines |
+ Inc substitution on |
+ {12:to}o lines |
+ |
+ {11:[No Name] [+] }|
+ |2| {12:to}o lines |
+ |4| {12:to}o lines |
+ {15:~ }|
+ {15:~ }|
+ {15:~ }|
+ {15:~ }|
+ {15:~ }|
+ {10:[Preview] }|
+ :topleft %s/tw/to^ |
+ ]])
+ feed('<Esc>')
+ screen:expect{any=[[two lines]]}
+
+ -- multiple modifiers
+ feed(':topleft vert %s/tw/to')
+ screen:expect([[
+ Inc substitution on |
+ {12:to}o lines |
+ Inc substitution on |
+ {12:to}o lines |
+ |
+ {11:[No Name] [+] }|
+ |2| {12:to}o lines |
+ |4| {12:to}o lines |
+ {15:~ }|
+ {15:~ }|
+ {15:~ }|
+ {15:~ }|
+ {15:~ }|
+ {10:[Preview] }|
+ :topleft vert %s/tw/to^ |
+ ]])
+ feed('<Esc>')
+ screen:expect{any=[[two lines]]}
+ end)
+
it('shows split window when typing the pattern', function()
feed(":%s/tw")
screen:expect([[