mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +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:
@@ -2508,7 +2508,7 @@ static int vgetorpeek(bool advance)
|
||||
unshowmode(true);
|
||||
mode_deleted = true;
|
||||
}
|
||||
validate_cursor();
|
||||
validate_cursor(curwin);
|
||||
int old_wcol = curwin->w_wcol;
|
||||
int old_wrow = curwin->w_wrow;
|
||||
|
||||
@@ -2541,7 +2541,7 @@ static int vgetorpeek(bool advance)
|
||||
curwin->w_wrow = curwin->w_cline_row
|
||||
+ curwin->w_wcol / curwin->w_width_inner;
|
||||
curwin->w_wcol %= curwin->w_width_inner;
|
||||
curwin->w_wcol += curwin_col_off();
|
||||
curwin->w_wcol += win_col_off(curwin);
|
||||
col = 0; // no correction needed
|
||||
} else {
|
||||
curwin->w_wcol--;
|
||||
|
Reference in New Issue
Block a user