diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-02-05 21:23:04 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-02-05 21:23:04 +0100 |
commit | ee8188fc74a7cf9ee7acb634b2bb7a032d0cb24c (patch) | |
tree | ea35e86c1df1da9e7a3594c49c96ed7947289c35 /src/buffer.c | |
parent | 2a78b7c70471527d83adef6b147dbfb6c9f838f7 (diff) |
patch 8.1.0877: new buffer used every time the quickfix window is openedv8.1.0877
Problem: New buffer used every time the quickfix window is opened.
Solution: Reuse the buffer. (Yegappan Lakshmanan, closes #3902)
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/buffer.c b/src/buffer.c index 98d505f18e..e0b616498a 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5753,17 +5753,14 @@ buf_spname(buf_T *buf) #if defined(FEAT_QUICKFIX) if (bt_quickfix(buf)) { - win_T *win; - tabpage_T *tp; - /* - * For location list window, w_llist_ref points to the location list. - * For quickfix window, w_llist_ref is NULL. + * Differentiate between the quickfix and location list buffers using + * the buffer number stored in the global quickfix stack. */ - if (find_win_for_buf(buf, &win, &tp) == OK && win->w_llist_ref != NULL) - return (char_u *)_(msg_loclist); - else + if (buf->b_fnum == qf_stack_get_bufnr()) return (char_u *)_(msg_qflist); + else + return (char_u *)_(msg_loclist); } #endif |