diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-10-13 10:46:42 +0800 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-13 10:46:42 +0800 | 
| commit | 186c489fd6b1073feefef0e2c3774d908bd06615 (patch) | |
| tree | 14f0615af4add0379696e1a5d4a2c5901501d92a /src/nvim/quickfix.c | |
| parent | 34c7007c32cd78b5589d72701c6669a2c378dd17 (diff) | |
| parent | cd1e0bb87dc71d51d9e8da097f5822c37e909335 (diff) | |
| download | rneovim-186c489fd6b1073feefef0e2c3774d908bd06615.tar.gz rneovim-186c489fd6b1073feefef0e2c3774d908bd06615.tar.bz2 rneovim-186c489fd6b1073feefef0e2c3774d908bd06615.zip  | |
Merge pull request #20629 from zeertzjq/vim-8.2.4453
vim-patch:8.2.{4453,4462}
Diffstat (limited to 'src/nvim/quickfix.c')
| -rw-r--r-- | src/nvim/quickfix.c | 20 | 
1 files changed, 14 insertions, 6 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index f9d139c466..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;          }        } @@ -7065,6 +7068,7 @@ void ex_helpgrep(exarg_T *eap)    bool updated = false;    // Make 'cpoptions' empty, the 'l' flag should not be used here.    char *const save_cpo = p_cpo; +  const bool save_cpo_allocated = is_option_allocated("cpo");    p_cpo = empty_option;    bool new_qi = false; @@ -7104,7 +7108,9 @@ void ex_helpgrep(exarg_T *eap)      if (*p_cpo == NUL) {        set_option_value_give_err("cpo", 0L, save_cpo, 0);      } -    free_string_option(save_cpo); +    if (save_cpo_allocated) { +      free_string_option(save_cpo); +    }    }    if (updated) { @@ -7139,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;      }    }  | 
