diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2022-02-24 12:33:17 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-02-24 12:33:17 +0000 |
commit | 9c9be05b17ececb1515a2f41a4dedbf848d3d8b6 (patch) | |
tree | 0f210dbd1a17a837409a004951b7a4d8b655961d /src/quickfix.c | |
parent | 3c620b0c0394b754597f68fdd9da5de76156f3ce (diff) | |
download | vim-git-9c9be05b17ececb1515a2f41a4dedbf848d3d8b6.tar.gz |
patch 8.2.4462: not enough testing for quickfix codev8.2.4462
Problem: Not enough testing for quickfix code.
Solution: Add more tests. Fix uncovered problem. (Yegappan Lakshmanan,
closes #9839)
Diffstat (limited to 'src/quickfix.c')
-rw-r--r-- | src/quickfix.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 16790b030..f954a16bf 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -2086,7 +2086,7 @@ check_quickfix_busy(void) /* * Add an entry to the end of the list of errors. - * Returns QF_OK or QF_FAIL. + * Returns QF_OK on success or QF_FAIL on a memory allocation failure. */ static int qf_add_entry( @@ -4051,9 +4051,6 @@ qf_view_result(int split) { qf_info_T *qi = &ql_info; - if (!bt_quickfix(curbuf)) - return; - if (IS_LL_WINDOW(curwin)) qi = GET_LOC_LIST(curwin); @@ -4525,8 +4522,12 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last) win = curwin; else { + // Find the file window (non-quickfix) with this location list win = qf_find_win_with_loclist(qi); if (win == NULL) + // File window is not found. Find the location list window. + win = qf_find_win(qi); + if (win == NULL) return; } qf_winid = win->w_id; @@ -8343,7 +8344,9 @@ ex_helpgrep(exarg_T *eap) if (new_qi) ll_free_all(&qi); } - else if (curwin->w_llist == NULL) + else if (curwin->w_llist == NULL && new_qi) + // current window didn't have a location list associated with it + // before. Associate the new location list now. curwin->w_llist = qi; } } |