From 26d08dfd0d9d2f8e3685a4fe083588519bd5dac0 Mon Sep 17 00:00:00 2001 From: KillTheMule Date: Mon, 28 Aug 2017 21:33:31 +0200 Subject: inccommand: fix optimization logic #7224 Before this change the preview changes in the buffer viewport were limited to the size of the preview window ('cmdwinheight'). closes #7220 --- test/functional/ui/inccommand_spec.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/functional/ui') diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua index 64965ccb94..e83bd72ad3 100644 --- a/test/functional/ui/inccommand_spec.lua +++ b/test/functional/ui/inccommand_spec.lua @@ -892,6 +892,31 @@ describe(":substitute, inccommand=split", function() ]]) end) + it('previews correctly when previewhight is small', function() + feed_command('set cwh=3') + feed_command('set hls') + feed('ggdG') + insert(string.rep('abc abc abc\n', 20)) + feed(':%s/abc/MMM/g') + screen:expect([[ + MMM MMM MMM | + MMM MMM MMM | + MMM MMM MMM | + MMM MMM MMM | + MMM MMM MMM | + MMM MMM MMM | + MMM MMM MMM | + MMM MMM MMM | + MMM MMM MMM | + {11:[No Name] [+] }| + | 1| {12:MMM} {12:MMM} {12:MMM} | + | 2| {12:MMM} {12:MMM} {12:MMM} | + | 3| {12:MMM} {12:MMM} {12:MMM} | + {10:[Preview] }| + :%s/abc/MMM/g^ | + ]]) + end) + it('actually replaces text', function() feed(":%s/tw/XX/g") -- cgit