mirror of
https://github.com/neovim/neovim.git
synced 2026-01-04 10:26:42 +10:00
fix(diff): filler lines for hunks bigger than linematch limit (#24676)
Apply linematch filler computation only if the hunk is actually linematched. Fixes #24580
This commit is contained in:
@@ -1178,4 +1178,48 @@ describe('regressions', function()
|
||||
helpers.curbufmeths.set_lines(0, -1, false, { string.rep('a', 1010)..'world' })
|
||||
helpers.exec 'windo diffthis'
|
||||
end)
|
||||
|
||||
it("properly computes filler lines for hunks bigger than linematch limit", function()
|
||||
clear()
|
||||
feed(':set diffopt+=linematch:10<cr>')
|
||||
screen = Screen.new(100, 20)
|
||||
screen:attach()
|
||||
local lines = {}
|
||||
for i = 0, 29 do
|
||||
lines[#lines + 1] = tostring(i)
|
||||
end
|
||||
helpers.curbufmeths.set_lines(0, -1, false, lines)
|
||||
helpers.exec 'vnew'
|
||||
helpers.curbufmeths.set_lines(0, -1, false, { '00', '29' })
|
||||
helpers.exec 'windo diffthis'
|
||||
feed('<C-e>')
|
||||
screen:expect{grid=[[
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:^1 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:2 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:3 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:4 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:5 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:6 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:7 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:8 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:9 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:10 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:11 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:12 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:13 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:14 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:15 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:16 }|
|
||||
{1: }{2:------------------------------------------------}│{1: }{3:17 }|
|
||||
{1: }29 │{1: }{3:18 }|
|
||||
{4:[No Name] [+] }{5:[No Name] [+] }|
|
||||
|
|
||||
]], attr_ids={
|
||||
[1] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.Grey};
|
||||
[2] = {bold = true, background = Screen.colors.LightCyan, foreground = Screen.colors.Blue1};
|
||||
[3] = {background = Screen.colors.LightBlue};
|
||||
[4] = {reverse = true};
|
||||
[5] = {reverse = true, bold = true};
|
||||
}}
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user