diff options
author | lonerover <pathfinder1644@yahoo.com> | 2017-03-14 22:07:48 +0800 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-03-14 15:07:48 +0100 |
commit | 227859ea79f981e67d5835cfed0be2123522ab2e (patch) | |
tree | 011c3a30e5682fcca49ee81f3d5f173f75c0d493 /src/nvim/quickfix.c | |
parent | 36fd879b2553baee69555fb237864972325039f1 (diff) | |
download | rneovim-227859ea79f981e67d5835cfed0be2123522ab2e.tar.gz rneovim-227859ea79f981e67d5835cfed0be2123522ab2e.tar.bz2 rneovim-227859ea79f981e67d5835cfed0be2123522ab2e.zip |
vim-patch:7.4.2264 (#6275)
Problem: When adding entries to an empty quickfix list the title is reset.
Solution: Improve handling of the title. (Yegappan Lakshmanan)
https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r-- | src/nvim/quickfix.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 40a8066f75..7f5e5a481b 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -4214,11 +4214,15 @@ static int qf_add_entries(qf_info_T *qi, list_T *list, char_u *title, return retval; } -static int qf_set_properties(qf_info_T *qi, dict_T *what) +static int qf_set_properties(qf_info_T *qi, dict_T *what, int action) { dictitem_T *di; int retval = FAIL; + int newlist = false; + if (action == ' ' || qi->qf_curlist == qi->qf_listcount) { + newlist = true; + } int qf_idx = qi->qf_curlist; // default is the current list if ((di = dict_find(what, (char_u *)"nr", -1)) != NULL) { // Use the specified quickfix/location list @@ -4230,6 +4234,12 @@ static int qf_set_properties(qf_info_T *qi, dict_T *what) } else { return FAIL; } + newlist = false; // use the specified list + } + + if (newlist) { + qf_new_list(qi, NULL); + qf_idx = qi->qf_curlist; } if ((di = dict_find(what, (char_u *)"title", -1)) != NULL) { @@ -4260,7 +4270,7 @@ int set_errorlist(win_T *wp, list_T *list, int action, char_u *title, } if (what != NULL) { - retval = qf_set_properties(qi, what); + retval = qf_set_properties(qi, what, action); } else { retval = qf_add_entries(qi, list, title, action); } |