diff src/buffer.c @ 15740:2fe4a503c5ad v8.1.0877

patch 8.1.0877: new buffer used every time the quickfix window is opened commit https://github.com/vim/vim/commit/ee8188fc74a7cf9ee7acb634b2bb7a032d0cb24c Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 5 21:23:04 2019 +0100 patch 8.1.0877: new buffer used every time the quickfix window is opened Problem: New buffer used every time the quickfix window is opened. Solution: Reuse the buffer. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/3902)
author Bram Moolenaar <Bram@vim.org>
date Tue, 05 Feb 2019 21:30:06 +0100
parents 6f1c7e9a6393
children c4efa095f323
line wrap: on
line diff
--- 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)
+	if (buf->b_fnum == qf_stack_get_bufnr())
+	    return (char_u *)_(msg_qflist);
+	else
 	    return (char_u *)_(msg_loclist);
-	else
-	    return (char_u *)_(msg_qflist);
     }
 #endif