fix(terminal): check terminal size at end of screen update

This commit is contained in:
zeertzjq
2023-10-03 10:23:03 +08:00
parent 749ff7a342
commit e0d98bd25d
2 changed files with 36 additions and 11 deletions

View File

@@ -44,7 +44,7 @@ describe(':terminal window', function()
{7:6 } |
{3:-- TERMINAL --} |
]])
feed_data({'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'})
feed_data('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
screen:expect([[
{7:1 }tty ready |
{7:2 }rows: 6, cols: 48 |
@@ -69,7 +69,7 @@ describe(':terminal window', function()
{7: 6 } |
{3:-- TERMINAL --} |
]])
feed_data({' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'})
feed_data(' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
screen:expect([[
{7: 1 }tty ready |
{7: 2 }rows: 6, cols: 48 |
@@ -82,6 +82,31 @@ describe(':terminal window', function()
end)
end)
describe("with 'statuscolumn'", function()
it('wraps text', function()
command([[set number statuscolumn=++%l\ \ ]])
screen:expect([[
{7:++1 }tty ready |
{7:++2 }rows: 6, cols: 45 |
{7:++3 }{1: } |
{7:++4 } |
{7:++5 } |
{7:++6 } |
{3:-- TERMINAL --} |
]])
feed_data('\n\n\n\n\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
screen:expect([[
{7:++4 } |
{7:++5 } |
{7:++6 } |
{7:++7 } |
{7:++8 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS|
{7:++9 }TUVWXYZ{1: } |
{3:-- TERMINAL --} |
]])
end)
end)
describe("with 'colorcolumn'", function()
before_each(function()
feed([[<C-\><C-N>]])