aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-07-28 10:22:19 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-07-28 23:58:34 -0400
commit91b8210779c11d5ff6c37929f67d76fd738987b5 (patch)
treef749c89ea6f4b06c25387b8a1fc714c08ec02b52 /src/nvim/quickfix.c
parenta2253744c9bcd9229be9533540075e977f0be2cd (diff)
downloadrneovim-91b8210779c11d5ff6c37929f67d76fd738987b5.tar.gz
rneovim-91b8210779c11d5ff6c37929f67d76fd738987b5.tar.bz2
rneovim-91b8210779c11d5ff6c37929f67d76fd738987b5.zip
vim-patch:8.0.0687: minor issues related to quickfix
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) https://github.com/vim/vim/commit/86f100dc0922e83bead7bcd5fd2bb2abbf153f46
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 664dd3e968..73cb79ef8a 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -1044,10 +1044,12 @@ qf_init_ext(
if (newlist || qi->qf_curlist == qi->qf_listcount) {
// make place for a new list
qf_new_list(qi, qf_title);
- } 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;
+ if (qi->qf_lists[qi->qf_curlist].qf_count > 0) {
+ old_last = qi->qf_lists[qi->qf_curlist].qf_last;
+ }
}
// Use the local value of 'errorformat' if it's set.
@@ -4209,7 +4211,8 @@ int get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict)
if (qi->qf_lists[qf_idx].qf_ctx != NULL) {
di = tv_dict_item_alloc_len(S_LEN("context"));
tv_copy(qi->qf_lists[qf_idx].qf_ctx, &di->di_tv);
- if (tv_dict_add(retdict, di) == FAIL) {
+ status = tv_dict_add(retdict, di);
+ if (status == FAIL) {
tv_dict_item_free(di);
}
} else {
@@ -4398,6 +4401,7 @@ static int qf_set_properties(qf_info_T *qi, dict_T *what, int action)
typval_T *ctx = xcalloc(1, sizeof(typval_T));
tv_copy(&di->di_tv, ctx);
qi->qf_lists[qf_idx].qf_ctx = ctx;
+ retval = OK;
}
return retval;