fix(screen): do not draw filler lines post eof if already at last row

(cherry picked from commit b326bf5f41)
This commit is contained in:
zeertzjq
2021-12-07 23:00:03 +08:00
committed by github-actions[bot]
parent b25b41997a
commit cee2de23ab
3 changed files with 90 additions and 1 deletions

View File

@@ -186,6 +186,19 @@ describe('Diff mode screen', function()
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
screen:try_resize(40, 9)
screen:expect([[
{1:+ }{5:^+-- 4 lines: 1···}{3:│}{1:+ }{5:+-- 4 lines: 1··}|
{1: }5 {3:│}{1: }5 |
{1: }6 {3:│}{1: }6 |
{1: }7 {3:│}{1: }7 |
{1: }8 {3:│}{1: }8 |
{1: }9 {3:│}{1: }9 |
{1: }10 {3:│}{1: }10 |
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
|
]])
end)
it('Add a line at the end of file 1', function()
@@ -232,6 +245,19 @@ describe('Diff mode screen', function()
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
screen:try_resize(40, 9)
screen:expect([[
{1:+ }{5:^+-- 4 lines: 1···}{3:│}{1:+ }{5:+-- 4 lines: 1··}|
{1: }5 {3:│}{1: }5 |
{1: }6 {3:│}{1: }6 |
{1: }7 {3:│}{1: }7 |
{1: }8 {3:│}{1: }8 |
{1: }9 {3:│}{1: }9 |
{1: }10 {3:│}{1: }10 |
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
|
]])
end)
it('Add a line in the middle of file 2, remove on at the end of file 1', function()