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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 7b22c95967..4e582108c5 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -1286,7 +1286,7 @@ void copy_loclist(win_T *from, win_T *to)
// Looking up a buffer can be slow if there are many. Remember the last one to
// make this a lot faster if there are multiple matches in the same file.
static char_u *qf_last_bufname = NULL;
-static buf_T *qf_last_buf = NULL;
+static bufref_T qf_last_bufref = { NULL, 0 };
// Get buffer number for file "directory.fname".
// Also sets the b_has_qf_entry flag.
@@ -1328,14 +1328,14 @@ static int qf_get_fnum(qf_info_T *qi, char_u *directory, char_u *fname)
if (qf_last_bufname != NULL
&& STRCMP(bufname, qf_last_bufname) == 0
- && buf_valid(qf_last_buf)) {
- buf = qf_last_buf;
+ && bufref_valid(&qf_last_bufref)) {
+ buf = qf_last_bufref.br_buf;
xfree(ptr);
} else {
xfree(qf_last_bufname);
buf = buflist_new(bufname, NULL, (linenr_T)0, BLN_NOOPT);
qf_last_bufname = (bufname == ptr) ? bufname : vim_strsave(bufname);
- qf_last_buf = buf;
+ set_bufref(&qf_last_bufref, buf);
}
if (buf == NULL) {
return 0;