Merge pull request #23503 from neovim/backport-23415-to-release-0.9

[Backport release-0.9] fix(tui): redraw on SIGWINCH even if size didn't change
This commit is contained in:
zeertzjq
2023-05-06 18:00:22 +08:00
committed by GitHub
2 changed files with 27 additions and 5 deletions

View File

@@ -1528,13 +1528,12 @@ void tui_guess_size(TUIData *tui)
height = DFLT_ROWS;
}
if (tui->width != width || tui->height != height) {
tui->width = width;
tui->height = height;
// Redraw on SIGWINCH event if size didn't change. #23411
ui_client_set_size(width, height);
}
}
static void unibi_goto(TUIData *tui, int row, int col)
{

View File

@@ -1565,6 +1565,29 @@ describe('TUI', function()
{5:-- TERMINAL --} |
]])
end)
it('redraws on SIGWINCH even if terminal size is unchanged #23411', function()
child_session:request('nvim_echo', {{'foo'}}, false, {})
screen:expect([[
{1: } |
{4:~ }|
{4:~ }|
{4:~ }|
{5:[No Name] }|
foo |
{3:-- TERMINAL --} |
]])
exec_lua([[vim.loop.kill(vim.fn.jobpid(vim.bo.channel), 'sigwinch')]])
screen:expect([[
{1: } |
{4:~ }|
{4:~ }|
{4:~ }|
{5:[No Name] }|
|
{3:-- TERMINAL --} |
]])
end)
end)
describe('TUI', function()