fix(terminal): avoid tailed cursor in focused terminal in events

Problem: in terminal mode, adjust_topline moves curwin's cursor to the last row
so set_topline tails the non-scrollback area. This may result in the observed
cursor position remaining tailed in events within the focused terminal, rather
than reflecting the actual cursor position.

Solution: use the focused terminal's actual cursor position immediately, rather
than relying on the next terminal_check_cursor call in terminal_check to set it.

Note: Maybe also possible for terminal mode cursor position to be stale
(reporting the normal mode position) when switching buffers in events to another
terminal until the next terminal_check call? (or until refresh_terminal is
called for it) Maybe not worth fixing that, though.
This commit is contained in:
Sean Dewar
2025-02-23 15:58:16 +00:00
committed by zeertzjq
parent 98dfd25c8b
commit 8c5bc4920a
3 changed files with 57 additions and 3 deletions

View File

@@ -2187,7 +2187,7 @@ void mb_adjust_cursor(void)
}
/// Checks and adjusts cursor column. Not mode-dependent.
/// @see check_cursor_col_win
/// @see check_cursor_col
///
/// @param win_ Places cursor on a valid column for this window.
void mb_check_adjust_col(void *win_)