aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-02 20:48:41 +0800
committerGitHub <noreply@github.com>2022-08-02 20:48:41 +0800
commitdef0ced4c7207ee38d77f146e1527f283e44b6f2 (patch)
treeae235ec9323900433e028084594f3b4dac4ba787 /src/nvim/window.c
parent8ce7e7409f10f0a90ed8aa3f6f179c4b5d44eacb (diff)
downloadrneovim-def0ced4c7207ee38d77f146e1527f283e44b6f2.tar.gz
rneovim-def0ced4c7207ee38d77f146e1527f283e44b6f2.tar.bz2
rneovim-def0ced4c7207ee38d77f146e1527f283e44b6f2.zip
fix(tabpage): check if ROWS_AVAIL changed for resize (#19620)
N/A patches for version.c: vim-patch:9.0.0135: comment about tabpage line above the wrong code Problem: Comment about tabpage line above the wrong code. Solution: Move the comment. (closes vim/vim#10836) https://github.com/vim/vim/commit/0b0ccbbfb014e1c9682b86a7a41ff2837b0b8047
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index e820be626c..c7f038850e 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -4293,7 +4293,7 @@ static int leave_tabpage(buf_T *new_curbuf, bool trigger_leave_autocmds)
tp->tp_prevwin = prevwin;
tp->tp_firstwin = firstwin;
tp->tp_lastwin = lastwin;
- tp->tp_old_Rows = Rows;
+ tp->tp_old_Rows_avail = ROWS_AVAIL;
tp->tp_old_Columns = Columns;
firstwin = NULL;
lastwin = NULL;
@@ -4333,10 +4333,7 @@ static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, bool trigger_enter_a
const int row = win_comp_pos(); // recompute w_winrow for all windows
diff_need_scrollbind = true;
- // The tabpage line may have appeared or disappeared, may need to resize
- // the frames for that. When the Vim window was resized need to update
- // frame sizes too. Use the stored value of p_ch, so that it can be
- // different for each tab page.
+ // Use the stored value of p_ch, so that it can be different for each tab page.
if (p_ch != curtab->tp_ch_used) {
clear_cmdline = true;
}
@@ -4349,7 +4346,9 @@ static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, bool trigger_enter_a
clear_cmdline = true;
}
- if (curtab->tp_old_Rows != Rows || (old_off != firstwin->w_winrow)) {
+ // The tabpage line may have appeared or disappeared, may need to resize the frames for that.
+ // When the Vim window was resized or ROWS_AVAIL changed need to update frame sizes too.
+ if (curtab->tp_old_Rows_avail != ROWS_AVAIL || (old_off != firstwin->w_winrow)) {
win_new_screen_rows();
}
if (curtab->tp_old_Columns != Columns && starting == 0) {