aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/inccommand_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-10-18 10:34:55 +0800
committerGitHub <noreply@github.com>2023-10-18 10:34:55 +0800
commit366d0c7887f76f0adc40671292db46f115c9317e (patch)
tree0074f8aac664961c0bc8cb2fc8fe47c00efa7ad9 /test/functional/ui/inccommand_spec.lua
parentbbc74d51ad791edad1948178736589cb181236e8 (diff)
downloadrneovim-366d0c7887f76f0adc40671292db46f115c9317e.tar.gz
rneovim-366d0c7887f76f0adc40671292db46f115c9317e.tar.bz2
rneovim-366d0c7887f76f0adc40671292db46f115c9317e.zip
fix(move): check the correct buffer (#25698)
Diffstat (limited to 'test/functional/ui/inccommand_spec.lua')
-rw-r--r--test/functional/ui/inccommand_spec.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index cb00c75e74..c9e004289d 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -3095,6 +3095,36 @@ it(':substitute with inccommand works properly if undo is not synced #20029', fu
baz]])
end)
+it(':substitute with inccommand does not unexpectedly change viewport #25697', function()
+ clear()
+ local screen = Screen.new(45, 5)
+ common_setup(screen, 'nosplit', long_multiline_text)
+ command('vnew | tabnew | tabclose')
+ screen:expect([[
+ ^ │£ m n |
+ {15:~ }│t œ ¥ |
+ {15:~ }│ |
+ {11:[No Name] }{10:[No Name] [+] }|
+ |
+ ]])
+ feed(':s/')
+ screen:expect([[
+ │£ m n |
+ {15:~ }│t œ ¥ |
+ {15:~ }│ |
+ {11:[No Name] }{10:[No Name] [+] }|
+ :s/^ |
+ ]])
+ feed('<Esc>')
+ screen:expect([[
+ ^ │£ m n |
+ {15:~ }│t œ ¥ |
+ {15:~ }│ |
+ {11:[No Name] }{10:[No Name] [+] }|
+ |
+ ]])
+end)
+
it('long :%s/ with inccommand does not collapse cmdline', function()
clear()
local screen = Screen.new(10,5)