mirror of
https://github.com/neovim/neovim.git
synced 2025-10-10 20:06:33 +00:00
fix(api/buffer): fix handling of viewport of non-current buffer
A lot of functions in move.c only worked for curwin, alternatively took a `wp` arg but still only work if that happens to be curwin. Refactor those that are needed for update_topline(wp) to work for any window. fixes #27723 fixes #27720
This commit is contained in:
@@ -612,7 +612,7 @@ static void terminal_check_cursor(void)
|
||||
row_to_linenr(term, term->cursor.row));
|
||||
// Nudge cursor when returning to normal-mode.
|
||||
int off = is_focused(term) ? 0 : (curwin->w_p_rl ? 1 : -1);
|
||||
coladvance(MAX(0, term->cursor.col + off));
|
||||
coladvance(curwin, MAX(0, term->cursor.col + off));
|
||||
}
|
||||
|
||||
// Function executed before each iteration of terminal mode.
|
||||
@@ -626,7 +626,7 @@ static int terminal_check(VimState *state)
|
||||
}
|
||||
|
||||
terminal_check_cursor();
|
||||
validate_cursor();
|
||||
validate_cursor(curwin);
|
||||
|
||||
if (must_redraw) {
|
||||
update_screen();
|
||||
|
Reference in New Issue
Block a user