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
This commit is contained in:
KillTheMule
2017-08-28 21:33:31 +02:00
committed by Justin M. Keyes
parent 06f8ad5b2a
commit 26d08dfd0d
2 changed files with 29 additions and 2 deletions

View File

@@ -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<Enter>")