mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00

Problem: w_wrow/col calculation in terminal_check_cursor is wrong when the terminal is smaller than the window. Common when there's a larger window open with the same terminal, or just after a resize (as refresh_size is deferred). Solution: don't calculate it; validate_cursor will correct it later if it's out-of-date. Note that the toplines set for the terminal (also before this PR) assume 'nowrap' (which is set by default for terminal windows), and that no weird stuff like filler lines are around. That means, for example, it's possible for the cursor to be moved off-screen if there's wrapped lines. If this happens, it's likely update_topline will move the cursor back on screen via validate_cursor or similar, but maybe this should be handled more elegantly in the future?