comparison 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
comparison
equal deleted inserted replaced
15739:ae6b78344fb9 15740:2fe4a503c5ad
5751 buf_spname(buf_T *buf) 5751 buf_spname(buf_T *buf)
5752 { 5752 {
5753 #if defined(FEAT_QUICKFIX) 5753 #if defined(FEAT_QUICKFIX)
5754 if (bt_quickfix(buf)) 5754 if (bt_quickfix(buf))
5755 { 5755 {
5756 win_T *win;
5757 tabpage_T *tp;
5758
5759 /* 5756 /*
5760 * For location list window, w_llist_ref points to the location list. 5757 * Differentiate between the quickfix and location list buffers using
5761 * For quickfix window, w_llist_ref is NULL. 5758 * the buffer number stored in the global quickfix stack.
5762 */ 5759 */
5763 if (find_win_for_buf(buf, &win, &tp) == OK && win->w_llist_ref != NULL) 5760 if (buf->b_fnum == qf_stack_get_bufnr())
5761 return (char_u *)_(msg_qflist);
5762 else
5764 return (char_u *)_(msg_loclist); 5763 return (char_u *)_(msg_loclist);
5765 else
5766 return (char_u *)_(msg_qflist);
5767 } 5764 }
5768 #endif 5765 #endif
5769 5766
5770 /* There is no _file_ when 'buftype' is "nofile", b_sfname 5767 /* There is no _file_ when 'buftype' is "nofile", b_sfname
5771 * contains the name as specified by the user. */ 5768 * contains the name as specified by the user. */