aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 7fdc998e20..aeac6e4905 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -3696,7 +3696,7 @@ void ex_copen(exarg_T *eap)
curwin->w_cursor.lnum = lnum;
curwin->w_cursor.col = 0;
check_cursor();
- update_topline(); // scroll to show the line
+ update_topline(curwin); // scroll to show the line
}
// Move the cursor in the quickfix window to "lnum".
@@ -3710,7 +3710,7 @@ static void qf_win_goto(win_T *win, linenr_T lnum)
curwin->w_cursor.col = 0;
curwin->w_cursor.coladd = 0;
curwin->w_curswant = 0;
- update_topline(); // scroll to show the line
+ update_topline(curwin); // scroll to show the line
redraw_later(curwin, VALID);
curwin->w_redr_status = true; // update ruler
curwin = old_curwin;
@@ -3824,17 +3824,21 @@ static buf_T *qf_find_buf(qf_info_T *qi)
return NULL;
}
-/// Update the w:quickfix_title variable in the quickfix/location list window
+/// Update the w:quickfix_title variable in the quickfix/location list window in
+/// all the tab pages.
static void qf_update_win_titlevar(qf_info_T *qi)
+ FUNC_ATTR_NONNULL_ALL
{
- win_T *win;
+ qf_list_T *const qfl = qf_get_curlist(qi);
+ win_T *const save_curwin = curwin;
- if ((win = qf_find_win(qi)) != NULL) {
- win_T *curwin_save = curwin;
- curwin = win;
- qf_set_title_var(qf_get_curlist(qi));
- curwin = curwin_save;
+ FOR_ALL_TAB_WINDOWS(tp, win) {
+ if (is_qf_win(win, qi)) {
+ curwin = win;
+ qf_set_title_var(qfl);
+ }
}
+ curwin = save_curwin;
}
// Find the quickfix buffer. If it exists, update the contents.