1
0
forked from aniani/vim

patch 8.1.1030: quickfix function arguments are inconsistent

Problem:    Quickfix function arguments are inconsistent.
Solution:   Pass a list pointer instead of info and index. (Yegappan
            Lakshmanan, closes #4135)
This commit is contained in:
Bram Moolenaar
2019-03-21 21:12:49 +01:00
parent 60ebd524cf
commit 0398e00a1b
2 changed files with 74 additions and 69 deletions

View File

@@ -160,10 +160,10 @@ static int quickfix_busy = 0;
static efm_T *fmt_start = NULL; // cached across qf_parse_line() calls static efm_T *fmt_start = NULL; // cached across qf_parse_line() calls
static void qf_new_list(qf_info_T *qi, char_u *qf_title); static void qf_new_list(qf_info_T *qi, char_u *qf_title);
static int qf_add_entry(qf_info_T *qi, int qf_idx, char_u *dir, char_u *fname, char_u *module, int bufnum, char_u *mesg, long lnum, int col, int vis_col, char_u *pattern, int nr, int type, int valid); static int qf_add_entry(qf_list_T *qfl, char_u *dir, char_u *fname, char_u *module, int bufnum, char_u *mesg, long lnum, int col, int vis_col, char_u *pattern, int nr, int type, int valid);
static void qf_free(qf_list_T *qfl); static void qf_free(qf_list_T *qfl);
static char_u *qf_types(int, int); static char_u *qf_types(int, int);
static int qf_get_fnum(qf_info_T *qi, int qf_idx, char_u *, char_u *); static int qf_get_fnum(qf_list_T *qfl, char_u *, char_u *);
static char_u *qf_push_dir(char_u *, struct dir_stack_T **, int is_file_stack); static char_u *qf_push_dir(char_u *, struct dir_stack_T **, int is_file_stack);
static char_u *qf_pop_dir(struct dir_stack_T **); static char_u *qf_pop_dir(struct dir_stack_T **);
static char_u *qf_guess_filepath(qf_list_T *qfl, char_u *); static char_u *qf_guess_filepath(qf_list_T *qfl, char_u *);
@@ -1322,8 +1322,6 @@ qf_parse_line_nomatch(char_u *linebuf, int linelen, qffields_T *fields)
*/ */
static int static int
qf_parse_multiline_pfx( qf_parse_multiline_pfx(
qf_info_T *qi,
int qf_idx,
int idx, int idx,
qf_list_T *qfl, qf_list_T *qfl,
qffields_T *fields) qffields_T *fields)
@@ -1361,7 +1359,7 @@ qf_parse_multiline_pfx(
qfprev->qf_col = fields->col; qfprev->qf_col = fields->col;
qfprev->qf_viscol = fields->use_viscol; qfprev->qf_viscol = fields->use_viscol;
if (!qfprev->qf_fnum) if (!qfprev->qf_fnum)
qfprev->qf_fnum = qf_get_fnum(qi, qf_idx, qfprev->qf_fnum = qf_get_fnum(qfl,
qfl->qf_directory, qfl->qf_directory,
*fields->namebuf || qfl->qf_directory != NULL *fields->namebuf || qfl->qf_directory != NULL
? fields->namebuf ? fields->namebuf
@@ -1381,8 +1379,7 @@ qf_parse_multiline_pfx(
*/ */
static int static int
qf_parse_line( qf_parse_line(
qf_info_T *qi, qf_list_T *qfl,
int qf_idx,
char_u *linebuf, char_u *linebuf,
int linelen, int linelen,
efm_T *fmt_first, efm_T *fmt_first,
@@ -1391,7 +1388,6 @@ qf_parse_line(
efm_T *fmt_ptr; efm_T *fmt_ptr;
int idx = 0; int idx = 0;
char_u *tail = NULL; char_u *tail = NULL;
qf_list_T *qfl = &qi->qf_lists[qf_idx];
int status; int status;
restofline: restofline:
@@ -1450,7 +1446,7 @@ restofline:
} }
else if (vim_strchr((char_u *)"CZ", idx) != NULL) else if (vim_strchr((char_u *)"CZ", idx) != NULL)
{ // continuation of multi-line msg { // continuation of multi-line msg
status = qf_parse_multiline_pfx(qi, qf_idx, idx, qfl, fields); status = qf_parse_multiline_pfx(idx, qfl, fields);
if (status != QF_OK) if (status != QF_OK)
return status; return status;
} }
@@ -1485,11 +1481,18 @@ qf_stack_empty(qf_info_T *qi)
* Returns TRUE if the specified quickfix/location list is empty. * Returns TRUE if the specified quickfix/location list is empty.
*/ */
static int static int
qf_list_empty(qf_info_T *qi, int qf_idx) qf_list_empty(qf_list_T *qfl)
{ {
if (qi == NULL || qf_idx < 0 || qf_idx >= LISTCOUNT) return qfl == NULL || qfl->qf_count <= 0;
return TRUE; }
return qi->qf_lists[qf_idx].qf_count <= 0;
/*
* Return a pointer to a list in the specified quickfix stack
*/
static qf_list_T *
qf_get_list(qf_info_T *qi, int idx)
{
return &qi->qf_lists[idx];
} }
/* /*
@@ -1631,11 +1634,11 @@ qf_init_ext(
{ {
// Adding to existing list, use last entry. // Adding to existing list, use last entry.
adding = TRUE; adding = TRUE;
if (!qf_list_empty(qi, qf_idx)) if (!qf_list_empty(qf_get_list(qi, qf_idx)))
old_last = qi->qf_lists[qf_idx].qf_last; old_last = qi->qf_lists[qf_idx].qf_last;
} }
qfl = &qi->qf_lists[qf_idx]; qfl = qf_get_list(qi, qf_idx);
// Use the local value of 'errorformat' if it's set. // Use the local value of 'errorformat' if it's set.
if (errorformat == p_efm && tv == NULL && *buf->b_p_efm != NUL) if (errorformat == p_efm && tv == NULL && *buf->b_p_efm != NUL)
@@ -1675,7 +1678,7 @@ qf_init_ext(
if (status == QF_END_OF_INPUT) // end of input if (status == QF_END_OF_INPUT) // end of input
break; break;
status = qf_parse_line(qi, qf_idx, state.linebuf, state.linelen, status = qf_parse_line(qfl, state.linebuf, state.linelen,
fmt_first, &fields); fmt_first, &fields);
if (status == QF_FAIL) if (status == QF_FAIL)
goto error2; goto error2;
@@ -1684,8 +1687,7 @@ qf_init_ext(
if (status == QF_IGNORE_LINE) if (status == QF_IGNORE_LINE)
continue; continue;
if (qf_add_entry(qi, if (qf_add_entry(qfl,
qf_idx,
qfl->qf_directory, qfl->qf_directory,
(*fields.namebuf || qfl->qf_directory != NULL) (*fields.namebuf || qfl->qf_directory != NULL)
? fields.namebuf ? fields.namebuf
@@ -1808,7 +1810,7 @@ qf_cmdtitle(char_u *cmd)
static qf_list_T * static qf_list_T *
qf_get_curlist(qf_info_T *qi) qf_get_curlist(qf_info_T *qi)
{ {
return &qi->qf_lists[qi->qf_curlist]; return qf_get_list(qi, qi->qf_curlist);
} }
/* /*
@@ -1924,7 +1926,7 @@ ll_free_all(qf_info_T **pqi)
wipe_qf_buffer(qi); wipe_qf_buffer(qi);
for (i = 0; i < qi->qf_listcount; ++i) for (i = 0; i < qi->qf_listcount; ++i)
qf_free(&qi->qf_lists[i]); qf_free(qf_get_list(qi, i));
vim_free(qi); vim_free(qi);
} }
} }
@@ -1947,7 +1949,7 @@ qf_free_all(win_T *wp)
else else
// quickfix list // quickfix list
for (i = 0; i < qi->qf_listcount; ++i) for (i = 0; i < qi->qf_listcount; ++i)
qf_free(&qi->qf_lists[i]); qf_free(qf_get_list(qi, i));
} }
/* /*
@@ -2010,8 +2012,7 @@ check_quickfix_busy(void)
*/ */
static int static int
qf_add_entry( qf_add_entry(
qf_info_T *qi, // quickfix list qf_list_T *qfl, // quickfix list entry
int qf_idx, // list index
char_u *dir, // optional directory name char_u *dir, // optional directory name
char_u *fname, // file name or NULL char_u *fname, // file name or NULL
char_u *module, // module name or NULL char_u *module, // module name or NULL
@@ -2025,7 +2026,6 @@ qf_add_entry(
int type, // type character int type, // type character
int valid) // valid entry int valid) // valid entry
{ {
qf_list_T *qfl = &qi->qf_lists[qf_idx];
qfline_T *qfp; qfline_T *qfp;
qfline_T **lastp; // pointer to qf_last or NULL qfline_T **lastp; // pointer to qf_last or NULL
@@ -2041,7 +2041,7 @@ qf_add_entry(
IS_QF_LIST(qfl) ? BUF_HAS_QF_ENTRY : BUF_HAS_LL_ENTRY; IS_QF_LIST(qfl) ? BUF_HAS_QF_ENTRY : BUF_HAS_LL_ENTRY;
} }
else else
qfp->qf_fnum = qf_get_fnum(qi, qf_idx, dir, fname); qfp->qf_fnum = qf_get_fnum(qfl, dir, fname);
if ((qfp->qf_text = vim_strsave(mesg)) == NULL) if ((qfp->qf_text = vim_strsave(mesg)) == NULL)
{ {
vim_free(qfp); vim_free(qfp);
@@ -2074,7 +2074,7 @@ qf_add_entry(
qfp->qf_valid = valid; qfp->qf_valid = valid;
lastp = &qfl->qf_last; lastp = &qfl->qf_last;
if (qf_list_empty(qi, qf_idx)) // first element in the list if (qf_list_empty(qfl)) // first element in the list
{ {
qfl->qf_start = qfp; qfl->qf_start = qfp;
qfl->qf_ptr = qfp; qfl->qf_ptr = qfp;
@@ -2141,7 +2141,7 @@ ll_get_or_alloc_list(win_T *wp)
* Copy location list entries from 'from_qfl' to 'to_qfl'. * Copy location list entries from 'from_qfl' to 'to_qfl'.
*/ */
static int static int
copy_loclist_entries(qf_list_T *from_qfl, qf_list_T *to_qfl, qf_info_T *to_qi) copy_loclist_entries(qf_list_T *from_qfl, qf_list_T *to_qfl)
{ {
int i; int i;
qfline_T *from_qfp; qfline_T *from_qfp;
@@ -2152,8 +2152,7 @@ copy_loclist_entries(qf_list_T *from_qfl, qf_list_T *to_qfl, qf_info_T *to_qi)
i < from_qfl->qf_count && from_qfp != NULL; i < from_qfl->qf_count && from_qfp != NULL;
++i, from_qfp = from_qfp->qf_next) ++i, from_qfp = from_qfp->qf_next)
{ {
if (qf_add_entry(to_qi, if (qf_add_entry(to_qfl,
to_qi->qf_curlist,
NULL, NULL,
NULL, NULL,
from_qfp->qf_module, from_qfp->qf_module,
@@ -2185,7 +2184,7 @@ copy_loclist_entries(qf_list_T *from_qfl, qf_list_T *to_qfl, qf_info_T *to_qi)
* Copy the specified location list 'from_qfl' to 'to_qfl'. * Copy the specified location list 'from_qfl' to 'to_qfl'.
*/ */
static int static int
copy_loclist(qf_list_T *from_qfl, qf_list_T *to_qfl, qf_info_T *to_qi) copy_loclist(qf_list_T *from_qfl, qf_list_T *to_qfl)
{ {
// Some of the fields are populated by qf_add_entry() // Some of the fields are populated by qf_add_entry()
to_qfl->qfl_type = from_qfl->qfl_type; to_qfl->qfl_type = from_qfl->qfl_type;
@@ -2209,7 +2208,7 @@ copy_loclist(qf_list_T *from_qfl, qf_list_T *to_qfl, qf_info_T *to_qi)
to_qfl->qf_ctx = NULL; to_qfl->qf_ctx = NULL;
if (from_qfl->qf_count) if (from_qfl->qf_count)
if (copy_loclist_entries(from_qfl, to_qfl, to_qi) == FAIL) if (copy_loclist_entries(from_qfl, to_qfl) == FAIL)
return FAIL; return FAIL;
to_qfl->qf_index = from_qfl->qf_index; // current index in the list to_qfl->qf_index = from_qfl->qf_index; // current index in the list
@@ -2260,8 +2259,8 @@ copy_loclist_stack(win_T *from, win_T *to)
{ {
to->w_llist->qf_curlist = idx; to->w_llist->qf_curlist = idx;
if (copy_loclist(&qi->qf_lists[idx], if (copy_loclist(qf_get_list(qi, idx),
&to->w_llist->qf_lists[idx], to->w_llist) == FAIL) qf_get_list(to->w_llist, idx)) == FAIL)
{ {
qf_free_all(to); qf_free_all(to);
return; return;
@@ -2276,9 +2275,8 @@ copy_loclist_stack(win_T *from, win_T *to)
* Also sets the b_has_qf_entry flag. * Also sets the b_has_qf_entry flag.
*/ */
static int static int
qf_get_fnum(qf_info_T *qi, int qf_idx, char_u *directory, char_u *fname) qf_get_fnum(qf_list_T *qfl, char_u *directory, char_u *fname)
{ {
qf_list_T *qfl = &qi->qf_lists[qf_idx];
char_u *ptr = NULL; char_u *ptr = NULL;
buf_T *buf; buf_T *buf;
char_u *bufname; char_u *bufname;
@@ -2906,7 +2904,7 @@ qf_goto_win_with_ll_file(win_T *use_win, int qf_fnum, qf_info_T *ll_ref)
// If the location list for the window is not set, then set it // If the location list for the window is not set, then set it
// to the location list from the location window // to the location list from the location window
if (win->w_llist == NULL) if (win->w_llist == NULL && ll_ref != NULL)
win_set_loclist(win, ll_ref); win_set_loclist(win, ll_ref);
} }
@@ -3312,7 +3310,7 @@ qf_jump_newwin(qf_info_T *qi,
if (qi == NULL) if (qi == NULL)
qi = &ql_info; qi = &ql_info;
if (qf_stack_empty(qi) || qf_list_empty(qi, qi->qf_curlist)) if (qf_stack_empty(qi) || qf_list_empty(qf_get_curlist(qi)))
{ {
emsg(_(e_quickfix)); emsg(_(e_quickfix));
return; return;
@@ -3506,7 +3504,7 @@ qf_list(exarg_T *eap)
} }
} }
if (qf_stack_empty(qi) || qf_list_empty(qi, qi->qf_curlist)) if (qf_stack_empty(qi) || qf_list_empty(qf_get_curlist(qi)))
{ {
emsg(_(e_quickfix)); emsg(_(e_quickfix));
return; return;
@@ -3790,9 +3788,12 @@ qf_mark_adjust(
} }
for (idx = 0; idx < qi->qf_listcount; ++idx) for (idx = 0; idx < qi->qf_listcount; ++idx)
if (!qf_list_empty(qi, idx)) {
for (i = 0, qfp = qi->qf_lists[idx].qf_start; qf_list_T *qfl = qf_get_list(qi, idx);
i < qi->qf_lists[idx].qf_count && qfp != NULL;
if (!qf_list_empty(qfl))
for (i = 0, qfp = qfl->qf_start;
i < qfl->qf_count && qfp != NULL;
++i, qfp = qfp->qf_next) ++i, qfp = qfp->qf_next)
if (qfp->qf_fnum == curbuf->b_fnum) if (qfp->qf_fnum == curbuf->b_fnum)
{ {
@@ -3807,6 +3808,7 @@ qf_mark_adjust(
else if (amount_after && qfp->qf_lnum > line2) else if (amount_after && qfp->qf_lnum > line2)
qfp->qf_lnum += amount_after; qfp->qf_lnum += amount_after;
} }
}
if (!found_one) if (!found_one)
curbuf->b_has_qf_entry &= ~buf_has_flag; curbuf->b_has_qf_entry &= ~buf_has_flag;
@@ -3872,7 +3874,7 @@ qf_view_result(int split)
if (IS_LL_WINDOW(curwin)) if (IS_LL_WINDOW(curwin))
qi = GET_LOC_LIST(curwin); qi = GET_LOC_LIST(curwin);
if (qf_list_empty(qi, qi->qf_curlist)) if (qf_list_empty(qf_get_curlist(qi)))
{ {
emsg(_(e_quickfix)); emsg(_(e_quickfix));
return; return;
@@ -3919,7 +3921,7 @@ ex_cwindow(exarg_T *eap)
// it if we have errors; otherwise, leave it closed. // it if we have errors; otherwise, leave it closed.
if (qf_stack_empty(qi) if (qf_stack_empty(qi)
|| qfl->qf_nonevalid || qfl->qf_nonevalid
|| qf_list_empty(qi, qi->qf_curlist)) || qf_list_empty(qf_get_curlist(qi)))
{ {
if (win != NULL) if (win != NULL)
ex_cclose(eap); ex_cclose(eap);
@@ -4580,7 +4582,7 @@ qf_jump_first(qf_info_T *qi, int_u save_qfid, int forceit)
return; return;
// Autocommands might have cleared the list, check for that. // Autocommands might have cleared the list, check for that.
if (!qf_list_empty(qi, qi->qf_curlist)) if (!qf_list_empty(qf_get_curlist(qi)))
qf_jump(qi, 0, 0, forceit); qf_jump(qi, 0, 0, forceit);
} }
@@ -5305,8 +5307,7 @@ vgr_match_buflines(
// Pass the buffer number so that it gets used even for a // Pass the buffer number so that it gets used even for a
// dummy buffer, unless duplicate_name is set, then the // dummy buffer, unless duplicate_name is set, then the
// buffer will be wiped out below. // buffer will be wiped out below.
if (qf_add_entry(qi, if (qf_add_entry(qf_get_curlist(qi),
qi->qf_curlist,
NULL, // dir NULL, // dir
fname, fname,
NULL, NULL,
@@ -5624,7 +5625,7 @@ ex_vimgrep(exarg_T *eap)
} }
// Jump to first match. // Jump to first match.
if (!qf_list_empty(qi, qi->qf_curlist)) if (!qf_list_empty(qf_get_curlist(qi)))
{ {
if ((flags & VGR_NOJUMP) == 0) if ((flags & VGR_NOJUMP) == 0)
vgr_jump_to_match(qi, eap->forceit, &redraw_for_dummy, vgr_jump_to_match(qi, eap->forceit, &redraw_for_dummy,
@@ -5837,6 +5838,7 @@ unload_dummy_buffer(buf_T *buf, char_u *dirname_start)
get_errorlist(qf_info_T *qi_arg, win_T *wp, int qf_idx, list_T *list) get_errorlist(qf_info_T *qi_arg, win_T *wp, int qf_idx, list_T *list)
{ {
qf_info_T *qi = qi_arg; qf_info_T *qi = qi_arg;
qf_list_T *qfl;
dict_T *dict; dict_T *dict;
char_u buf[2]; char_u buf[2];
qfline_T *qfp; qfline_T *qfp;
@@ -5857,11 +5859,15 @@ get_errorlist(qf_info_T *qi_arg, win_T *wp, int qf_idx, list_T *list)
if (qf_idx == INVALID_QFIDX) if (qf_idx == INVALID_QFIDX)
qf_idx = qi->qf_curlist; qf_idx = qi->qf_curlist;
if (qf_idx >= qi->qf_listcount || qf_list_empty(qi, qf_idx)) if (qf_idx >= qi->qf_listcount)
return FAIL; return FAIL;
qfp = qi->qf_lists[qf_idx].qf_start; qfl = qf_get_list(qi, qf_idx);
for (i = 1; !got_int && i <= qi->qf_lists[qf_idx].qf_count; ++i) if (qf_list_empty(qfl))
return FAIL;
qfp = qfl->qf_start;
for (i = 1; !got_int && i <= qfl->qf_count; ++i)
{ {
// Handle entries with a non-existing buffer number. // Handle entries with a non-existing buffer number.
bufnum = qfp->qf_fnum; bufnum = qfp->qf_fnum;
@@ -6215,10 +6221,10 @@ qf_getprop_ctx(qf_list_T *qfl, dict_T *retdict)
* Return the current quickfix list index as 'idx' in retdict * Return the current quickfix list index as 'idx' in retdict
*/ */
static int static int
qf_getprop_idx(qf_info_T *qi, int qf_idx, dict_T *retdict) qf_getprop_idx(qf_list_T *qfl, dict_T *retdict)
{ {
int curidx = qi->qf_lists[qf_idx].qf_index; int curidx = qfl->qf_index;
if (qf_list_empty(qi, qf_idx)) if (qf_list_empty(qfl))
// For empty lists, current index is set to 0 // For empty lists, current index is set to 0
curidx = 0; curidx = 0;
return dict_add_number(retdict, "idx", curidx); return dict_add_number(retdict, "idx", curidx);
@@ -6254,7 +6260,7 @@ qf_get_properties(win_T *wp, dict_T *what, dict_T *retdict)
if (qf_stack_empty(qi) || qf_idx == INVALID_QFIDX) if (qf_stack_empty(qi) || qf_idx == INVALID_QFIDX)
return qf_getprop_defaults(qi, flags, wp != NULL, retdict); return qf_getprop_defaults(qi, flags, wp != NULL, retdict);
qfl = &qi->qf_lists[qf_idx]; qfl = qf_get_list(qi, qf_idx);
if (flags & QF_GETLIST_TITLE) if (flags & QF_GETLIST_TITLE)
status = qf_getprop_title(qfl, retdict); status = qf_getprop_title(qfl, retdict);
@@ -6269,7 +6275,7 @@ qf_get_properties(win_T *wp, dict_T *what, dict_T *retdict)
if ((status == OK) && (flags & QF_GETLIST_ID)) if ((status == OK) && (flags & QF_GETLIST_ID))
status = dict_add_number(retdict, "id", qfl->qf_id); status = dict_add_number(retdict, "id", qfl->qf_id);
if ((status == OK) && (flags & QF_GETLIST_IDX)) if ((status == OK) && (flags & QF_GETLIST_IDX))
status = qf_getprop_idx(qi, qf_idx, retdict); status = qf_getprop_idx(qfl, retdict);
if ((status == OK) && (flags & QF_GETLIST_SIZE)) if ((status == OK) && (flags & QF_GETLIST_SIZE))
status = dict_add_number(retdict, "size", qfl->qf_count); status = dict_add_number(retdict, "size", qfl->qf_count);
if ((status == OK) && (flags & QF_GETLIST_TICK)) if ((status == OK) && (flags & QF_GETLIST_TICK))
@@ -6289,8 +6295,7 @@ qf_get_properties(win_T *wp, dict_T *what, dict_T *retdict)
*/ */
static int static int
qf_add_entry_from_dict( qf_add_entry_from_dict(
qf_info_T *qi, qf_list_T *qfl,
int qf_idx,
dict_T *d, dict_T *d,
int first_entry, int first_entry,
int *valid_entry) int *valid_entry)
@@ -6337,8 +6342,7 @@ qf_add_entry_from_dict(
if ((dict_find(d, (char_u *)"valid", -1)) != NULL) if ((dict_find(d, (char_u *)"valid", -1)) != NULL)
valid = (int)dict_get_number(d, (char_u *)"valid"); valid = (int)dict_get_number(d, (char_u *)"valid");
status = qf_add_entry(qi, status = qf_add_entry(qfl,
qf_idx,
NULL, // dir NULL, // dir
filename, filename,
module, module,
@@ -6376,7 +6380,7 @@ qf_add_entries(
char_u *title, char_u *title,
int action) int action)
{ {
qf_list_T *qfl = &qi->qf_lists[qf_idx]; qf_list_T *qfl = qf_get_list(qi, qf_idx);
listitem_T *li; listitem_T *li;
dict_T *d; dict_T *d;
qfline_T *old_last = NULL; qfline_T *old_last = NULL;
@@ -6388,9 +6392,9 @@ qf_add_entries(
// make place for a new list // make place for a new list
qf_new_list(qi, title); qf_new_list(qi, title);
qf_idx = qi->qf_curlist; qf_idx = qi->qf_curlist;
qfl = &qi->qf_lists[qf_idx]; qfl = qf_get_list(qi, qf_idx);
} }
else if (action == 'a' && !qf_list_empty(qi, qf_idx)) else if (action == 'a' && !qf_list_empty(qfl))
// Adding to existing list, use last entry. // Adding to existing list, use last entry.
old_last = qfl->qf_last; old_last = qfl->qf_last;
else if (action == 'r') else if (action == 'r')
@@ -6408,7 +6412,7 @@ qf_add_entries(
if (d == NULL) if (d == NULL)
continue; continue;
retval = qf_add_entry_from_dict(qi, qf_idx, d, li == list->lv_first, retval = qf_add_entry_from_dict(qfl, d, li == list->lv_first,
&valid_entry); &valid_entry);
if (retval == FAIL) if (retval == FAIL)
break; break;
@@ -6427,7 +6431,7 @@ qf_add_entries(
// Update the current error index if not appending to the list or if the // Update the current error index if not appending to the list or if the
// list was empty before and it is not empty now. // list was empty before and it is not empty now.
if ((action != 'a' || qfl->qf_index == 0) && !qf_list_empty(qi, qf_idx)) if ((action != 'a' || qfl->qf_index == 0) && !qf_list_empty(qfl))
qfl->qf_index = 1; qfl->qf_index = 1;
// Don't update the cursor in quickfix window when appending entries // Don't update the cursor in quickfix window when appending entries
@@ -6504,7 +6508,7 @@ qf_setprop_get_qfidx(
static int static int
qf_setprop_title(qf_info_T *qi, int qf_idx, dict_T *what, dictitem_T *di) qf_setprop_title(qf_info_T *qi, int qf_idx, dict_T *what, dictitem_T *di)
{ {
qf_list_T *qfl = &qi->qf_lists[qf_idx]; qf_list_T *qfl = qf_get_list(qi, qf_idx);
if (di->di_tv.v_type != VAR_STRING) if (di->di_tv.v_type != VAR_STRING)
return FAIL; return FAIL;
@@ -6663,7 +6667,7 @@ qf_set_properties(qf_info_T *qi, dict_T *what, int action, char_u *title)
qf_idx = qi->qf_curlist; qf_idx = qi->qf_curlist;
} }
qfl = &qi->qf_lists[qf_idx]; qfl = qf_get_list(qi, qf_idx);
if ((di = dict_find(what, (char_u *)"title", -1)) != NULL) if ((di = dict_find(what, (char_u *)"title", -1)) != NULL)
retval = qf_setprop_title(qi, qf_idx, what, di); retval = qf_setprop_title(qi, qf_idx, what, di);
if ((di = dict_find(what, (char_u *)"items", -1)) != NULL) if ((di = dict_find(what, (char_u *)"items", -1)) != NULL)
@@ -7113,8 +7117,7 @@ hgr_search_file(
while (l > 0 && line[l - 1] <= ' ') while (l > 0 && line[l - 1] <= ' ')
line[--l] = NUL; line[--l] = NUL;
if (qf_add_entry(qi, if (qf_add_entry(qf_get_curlist(qi),
qi->qf_curlist,
NULL, // dir NULL, // dir
fname, fname,
NULL, NULL,
@@ -7310,7 +7313,7 @@ ex_helpgrep(exarg_T *eap)
} }
// Jump to first match. // Jump to first match.
if (!qf_list_empty(qi, qi->qf_curlist)) if (!qf_list_empty(qf_get_curlist(qi)))
qf_jump(qi, 0, 0, FALSE); qf_jump(qi, 0, 0, FALSE);
else else
semsg(_(e_nomatch2), eap->arg); semsg(_(e_nomatch2), eap->arg);

View File

@@ -779,6 +779,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1030,
/**/ /**/
1029, 1029,
/**/ /**/