diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-10 13:11:34 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-10 20:20:56 -0400 |
commit | e82b8ddef16eb7ce96e1d3d063ff529f79ed6bb2 (patch) | |
tree | 4c1558bdccbb800f3b8de73789d18242884101df /src/nvim/buffer.c | |
parent | e9004e2af0479868b1c9860d9cf49d073fdaeeed (diff) | |
download | rneovim-e82b8ddef16eb7ce96e1d3d063ff529f79ed6bb2.tar.gz rneovim-e82b8ddef16eb7ce96e1d3d063ff529f79ed6bb2.tar.bz2 rneovim-e82b8ddef16eb7ce96e1d3d063ff529f79ed6bb2.zip |
vim-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 vim/vim#3902)
https://github.com/vim/vim/commit/ee8188fc74a7cf9ee7acb634b2bb7a032d0cb24c
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index ec633dcc26..0fda66105f 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -5397,18 +5397,12 @@ bool buf_hide(const buf_T *const buf) char_u *buf_spname(buf_T *buf) { 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. - */ - if (find_win_for_buf(buf, &win, &tp) && win->w_llist_ref != NULL) { - return (char_u *)_(msg_loclist); - } else { + // Differentiate between the quickfix and location list buffers using + // the buffer number stored in the global quickfix stack. + if (buf->b_fnum == qf_stack_get_bufnr()) { return (char_u *)_(msg_qflist); } + return (char_u *)_(msg_loclist); } // There is no _file_ when 'buftype' is "nofile", b_sfname // contains the name as specified by the user. |