Minor improvements in vertical cusror motion

* src/xdisp.c (move_it_vertically_backward): Zero out cached value
of line height, to avoid using stale and incorrect values.
(try_window_reusing_current_matrix): Fix conditions for changes in
tab-line height.
Reported by Michael Heerdegen <michael_heerdegen@mailbox.org> in
https://lists.gnu.org/archive/html/help-gnu-emacs/2026-01/msg00163.html
This improves the scrolling a little bit, but doesn't solve the
problem entirely.
This commit is contained in:
Eli Zaretskii 2026-02-01 17:26:56 +02:00
parent ac07913bd8
commit 2652e11930

View file

@ -11300,6 +11300,7 @@ move_it_vertically_backward (struct it *it, int dy)
int line_height; int line_height;
RESTORE_IT (&it3, &it3, it3data); RESTORE_IT (&it3, &it3, it3data);
last_height = 0;
y1 = line_bottom_y (&it3); y1 = line_bottom_y (&it3);
line_height = y1 - y0; line_height = y1 - y0;
RESTORE_IT (it, it, it2data); RESTORE_IT (it, it, it2data);
@ -21673,8 +21674,9 @@ try_window_reusing_current_matrix (struct window *w)
return false; return false;
/* If top-line visibility has changed, give up. */ /* If top-line visibility has changed, give up. */
if (window_wants_tab_line (w) if (!w->current_matrix->header_line_p
!= MATRIX_TAB_LINE_ROW (w->current_matrix)->mode_line_p) && (window_wants_tab_line (w)
!= MATRIX_TAB_LINE_ROW (w->current_matrix)->mode_line_p))
return false; return false;
/* If top-line visibility has changed, give up. */ /* If top-line visibility has changed, give up. */