neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit d94db802277bd55dd14d59f88fcc935ee55820e2
parent 5abba97d77f2a5c4a47a68cad4063b4de303b95c
Author: bfredl <bjorn.linse@gmail.com>
Date:   Sat,  6 May 2023 11:48:33 +0200

Merge pull request #23415 from zeertzjq/sigwinch-redraw

fix(tui): redraw on SIGWINCH even if size didn't change
Diffstat:
Msrc/nvim/tui/tui.c | 9++++-----
Mtest/functional/terminal/tui_spec.lua | 23+++++++++++++++++++++++
2 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c @@ -1529,12 +1529,11 @@ void tui_guess_size(TUIData *tui) height = DFLT_ROWS; } - if (tui->width != width || tui->height != height) { - tui->width = width; - tui->height = height; + tui->width = width; + tui->height = height; - ui_client_set_size(width, 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) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua @@ -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()