mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
vim-patch:8.2.3762: if quickfix buffer is wiped out getqflist() still returns it
Problem: If the quickfix buffer is wiped out getqflist() still returns its
number.
Solution: Use zero if the buffer is no longer present. (Yegappan Lakshmanan,
closes vim/vim#9306)
56150da687
This commit is contained in:
@@ -6020,12 +6020,18 @@ static int qf_winid(qf_info_T *qi)
|
||||
}
|
||||
|
||||
/// Returns the number of the buffer displayed in the quickfix/location list
|
||||
/// window. If there is no buffer associated with the list, then returns 0.
|
||||
/// window. If there is no buffer associated with the list or the buffer is
|
||||
/// wiped out, then returns 0.
|
||||
static int qf_getprop_qfbufnr(const qf_info_T *qi, dict_T *retdict)
|
||||
FUNC_ATTR_NONNULL_ARG(2)
|
||||
{
|
||||
return tv_dict_add_nr(retdict, S_LEN("qfbufnr"),
|
||||
(qi == NULL) ? 0 : qi->qf_bufnr);
|
||||
int bufnum = 0;
|
||||
|
||||
if (qi != NULL && buflist_findnr(qi->qf_bufnr) != NULL) {
|
||||
bufnum = qi->qf_bufnr;
|
||||
}
|
||||
|
||||
return tv_dict_add_nr(retdict, S_LEN("qfbufnr"), bufnum);
|
||||
}
|
||||
|
||||
/// Convert the keys in 'what' to quickfix list property flags.
|
||||
|
Reference in New Issue
Block a user