diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-06-28 21:26:27 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-06-28 21:26:27 +0200 |
commit | 86f100dc0922e83bead7bcd5fd2bb2abbf153f46 (patch) | |
tree | 2d00b6024df7c7d45317f69bd80703e2e7c554e7 /src/quickfix.c | |
parent | 9f5f7bf4d5f757ef885acf74ce03c25429a328aa (diff) | |
download | vim-git-86f100dc0922e83bead7bcd5fd2bb2abbf153f46.tar.gz |
patch 8.0.0687: minor issues related to quickfixv8.0.0687
Problem: Minor issues related to quickfix.
Solution: Set the proper return status for all cases in setqflist() and at
test cases for this. Move the "adding" flag outside of
FEAT_WINDOWS. Minor update to the setqflist() help text. (Yegappan
Lakshmanan)
Diffstat (limited to 'src/quickfix.c')
-rw-r--r-- | src/quickfix.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 084d82ec0..3889a9565 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -1163,8 +1163,8 @@ qf_init_ext( qffields_T fields; #ifdef FEAT_WINDOWS qfline_T *old_last = NULL; - int adding = FALSE; #endif + int adding = FALSE; static efm_T *fmt_first = NULL; char_u *efm; static char_u *last_efm = NULL; @@ -1199,14 +1199,15 @@ qf_init_ext( if (newlist || qi->qf_curlist == qi->qf_listcount) /* make place for a new list */ qf_new_list(qi, qf_title); -#ifdef FEAT_WINDOWS - else if (qi->qf_lists[qi->qf_curlist].qf_count > 0) + else { /* Adding to existing list, use last entry. */ adding = TRUE; - old_last = qi->qf_lists[qi->qf_curlist].qf_last; - } +#ifdef FEAT_WINDOWS + if (qi->qf_lists[qi->qf_curlist].qf_count > 0) + old_last = qi->qf_lists[qi->qf_curlist].qf_last; #endif + } /* Use the local value of 'errorformat' if it's set. */ if (errorformat == p_efm && tv == NULL && *buf->b_p_efm != NUL) @@ -4785,6 +4786,8 @@ get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict) (void)get_errorlist(wp, qf_idx, l); dict_add_list(retdict, "items", l); } + else + status = FAIL; } if ((status == OK) && (flags & QF_GETLIST_CONTEXT)) @@ -4795,9 +4798,12 @@ get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict) if (di != NULL) { copy_tv(qi->qf_lists[qf_idx].qf_ctx, &di->di_tv); - if (dict_add(retdict, di) == FAIL) + status = dict_add(retdict, di); + if (status == FAIL) dictitem_free(di); } + else + status = FAIL; } else status = dict_add_nr_str(retdict, "context", 0L, (char_u *)""); @@ -5020,6 +5026,7 @@ qf_set_properties(qf_info_T *qi, dict_T *what, int action) if (ctx != NULL) copy_tv(&di->di_tv, ctx); qi->qf_lists[qf_idx].qf_ctx = ctx; + retval = OK; } return retval; |