mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 20:18: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:
@@ -2889,12 +2889,12 @@ static void qf_jump_goto_line(linenr_T qf_lnum, int qf_col, char qf_viscol, char
|
||||
if (qf_col > 0) {
|
||||
curwin->w_cursor.coladd = 0;
|
||||
if (qf_viscol == true) {
|
||||
coladvance(qf_col - 1);
|
||||
coladvance(curwin, qf_col - 1);
|
||||
} else {
|
||||
curwin->w_cursor.col = qf_col - 1;
|
||||
}
|
||||
curwin->w_set_curswant = true;
|
||||
check_cursor();
|
||||
check_cursor(curwin);
|
||||
} else {
|
||||
beginline(BL_WHITE | BL_FIX);
|
||||
}
|
||||
@@ -3831,7 +3831,7 @@ void ex_copen(exarg_T *eap)
|
||||
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
curwin->w_cursor.col = 0;
|
||||
check_cursor();
|
||||
check_cursor(curwin);
|
||||
update_topline(curwin); // scroll to show the line
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user