diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-10-13 10:13:17 +0800 | 
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-10-13 10:20:42 +0800 | 
| commit | cd1e0bb87dc71d51d9e8da097f5822c37e909335 (patch) | |
| tree | 14f0615af4add0379696e1a5d4a2c5901501d92a /src/nvim/quickfix.c | |
| parent | 73bdfdd382bf2addd7816571608db6911448b48a (diff) | |
| download | rneovim-cd1e0bb87dc71d51d9e8da097f5822c37e909335.tar.gz rneovim-cd1e0bb87dc71d51d9e8da097f5822c37e909335.tar.bz2 rneovim-cd1e0bb87dc71d51d9e8da097f5822c37e909335.zip | |
vim-patch:8.2.4462: not enough testing for quickfix code
Problem:    Not enough testing for quickfix code.
Solution:   Add more tests. Fix uncovered problem. (Yegappan Lakshmanan,
            closes vim/vim#9839)
https://github.com/vim/vim/commit/9c9be05b17ececb1515a2f41a4dedbf848d3d8b6
Omit Test_helpgrep_vim9_restore_cpo().
Cherry-pick test_quickfix.vim change from patch 8.2.0644.
Diffstat (limited to 'src/nvim/quickfix.c')
| -rw-r--r-- | src/nvim/quickfix.c | 15 | 
1 files changed, 10 insertions, 5 deletions
| diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 1b21d26dd3..d364cebc9d 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -1790,7 +1790,7 @@ void check_quickfix_busy(void)  /// @param  type     type character  /// @param  valid    valid entry  /// -/// @returns QF_OK or QF_FAIL. +/// @return  QF_OK on success or QF_FAIL on failure.  static int qf_add_entry(qf_list_T *qfl, char *dir, char *fname, char *module, int bufnum,                          char *mesg, linenr_T lnum, linenr_T end_lnum, int col, int end_col,                          char vis_col, char *pattern, int nr, char type, char valid) @@ -3461,12 +3461,10 @@ void qf_view_result(bool split)  {    qf_info_T *qi = &ql_info; -  if (!bt_quickfix(curbuf)) { -    return; -  }    if (IS_LL_WINDOW(curwin)) {      qi = GET_LOC_LIST(curwin);    } +    if (qf_list_empty(qf_get_curlist(qi))) {      emsg(_(e_no_errors));      return; @@ -3869,8 +3867,13 @@ static void qf_update_buffer(qf_info_T *qi, qfline_T *old_last)        if (curwin->w_llist == qi) {          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;          }        } @@ -7142,7 +7145,9 @@ void 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;      }    } | 
