From 366d0c7887f76f0adc40671292db46f115c9317e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 18 Oct 2023 10:34:55 +0800 Subject: fix(move): check the correct buffer (#25698) --- test/functional/ui/inccommand_spec.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test/functional/ui/inccommand_spec.lua') 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('') + 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) -- cgit