Patch 8.1.1030
Problem:    Quickfix function arguments are inconsistent.
Solution:   Pass a list pointer instead of info and index. (Yegappan
            Lakshmanan, closes #4135)
Files:      src/quickfix.c


*** ../vim-8.1.1029/src/quickfix.c      2019-03-17 16:39:01.566006172 +0100
--- src/quickfix.c      2019-03-21 21:09:35.184333803 +0100
***************
*** 160,169 ****
  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 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 void   qf_free(qf_list_T *qfl);
  static char_u *qf_types(int, int);
! static int    qf_get_fnum(qf_info_T *qi, int qf_idx, char_u *, char_u *);
  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_guess_filepath(qf_list_T *qfl, char_u *);
--- 160,169 ----
  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 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 char_u *qf_types(int, int);
! 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_pop_dir(struct dir_stack_T **);
  static char_u *qf_guess_filepath(qf_list_T *qfl, char_u *);
***************
*** 1322,1329 ****
   */
      static int
  qf_parse_multiline_pfx(
-       qf_info_T *qi,
-       int qf_idx,
        int idx,
        qf_list_T *qfl,
        qffields_T *fields)
--- 1322,1327 ----
***************
*** 1361,1367 ****
            qfprev->qf_col = fields->col;
        qfprev->qf_viscol = fields->use_viscol;
        if (!qfprev->qf_fnum)
!           qfprev->qf_fnum = qf_get_fnum(qi, qf_idx,
                    qfl->qf_directory,
                    *fields->namebuf || qfl->qf_directory != NULL
                    ? fields->namebuf
--- 1359,1365 ----
            qfprev->qf_col = fields->col;
        qfprev->qf_viscol = fields->use_viscol;
        if (!qfprev->qf_fnum)
!           qfprev->qf_fnum = qf_get_fnum(qfl,
                    qfl->qf_directory,
                    *fields->namebuf || qfl->qf_directory != NULL
                    ? fields->namebuf
***************
*** 1381,1388 ****
   */
      static int
  qf_parse_line(
!       qf_info_T       *qi,
!       int             qf_idx,
        char_u          *linebuf,
        int             linelen,
        efm_T           *fmt_first,
--- 1379,1385 ----
   */
      static int
  qf_parse_line(
!       qf_list_T       *qfl,
        char_u          *linebuf,
        int             linelen,
        efm_T           *fmt_first,
***************
*** 1391,1397 ****
      efm_T             *fmt_ptr;
      int                       idx = 0;
      char_u            *tail = NULL;
-     qf_list_T         *qfl = &qi->qf_lists[qf_idx];
      int                       status;
  
  restofline:
--- 1388,1393 ----
***************
*** 1450,1456 ****
        }
        else if (vim_strchr((char_u *)"CZ", idx) != NULL)
        {                               // continuation of multi-line msg
!           status = qf_parse_multiline_pfx(qi, qf_idx, idx, qfl, fields);
            if (status != QF_OK)
                return status;
        }
--- 1446,1452 ----
        }
        else if (vim_strchr((char_u *)"CZ", idx) != NULL)
        {                               // continuation of multi-line msg
!           status = qf_parse_multiline_pfx(idx, qfl, fields);
            if (status != QF_OK)
                return status;
        }
***************
*** 1485,1495 ****
   * Returns TRUE if the specified quickfix/location list is empty.
   */
      static int
! qf_list_empty(qf_info_T *qi, int qf_idx)
  {
!     if (qi == NULL || qf_idx < 0 || qf_idx >= LISTCOUNT)
!       return TRUE;
!     return qi->qf_lists[qf_idx].qf_count <= 0;
  }
  
  /*
--- 1481,1498 ----
   * Returns TRUE if the specified quickfix/location list is empty.
   */
      static int
! qf_list_empty(qf_list_T *qfl)
! {
!     return qfl == NULL || qfl->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,1641 ****
      {
        // Adding to existing list, use last entry.
        adding = TRUE;
!       if (!qf_list_empty(qi, qf_idx))
            old_last = qi->qf_lists[qf_idx].qf_last;
      }
  
!     qfl = &qi->qf_lists[qf_idx];
  
      // Use the local value of 'errorformat' if it's set.
      if (errorformat == p_efm && tv == NULL && *buf->b_p_efm != NUL)
--- 1634,1644 ----
      {
        // Adding to existing list, use last entry.
        adding = TRUE;
!       if (!qf_list_empty(qf_get_list(qi, qf_idx)))
            old_last = qi->qf_lists[qf_idx].qf_last;
      }
  
!     qfl = qf_get_list(qi, qf_idx);
  
      // Use the local value of 'errorformat' if it's set.
      if (errorformat == p_efm && tv == NULL && *buf->b_p_efm != NUL)
***************
*** 1675,1681 ****
        if (status == QF_END_OF_INPUT)  // end of input
            break;
  
!       status = qf_parse_line(qi, qf_idx, state.linebuf, state.linelen,
                                                        fmt_first, &fields);
        if (status == QF_FAIL)
            goto error2;
--- 1678,1684 ----
        if (status == QF_END_OF_INPUT)  // end of input
            break;
  
!       status = qf_parse_line(qfl, state.linebuf, state.linelen,
                                                        fmt_first, &fields);
        if (status == QF_FAIL)
            goto error2;
***************
*** 1684,1691 ****
        if (status == QF_IGNORE_LINE)
            continue;
  
!       if (qf_add_entry(qi,
!                       qf_idx,
                        qfl->qf_directory,
                        (*fields.namebuf || qfl->qf_directory != NULL)
                            ? fields.namebuf
--- 1687,1693 ----
        if (status == QF_IGNORE_LINE)
            continue;
  
!       if (qf_add_entry(qfl,
                        qfl->qf_directory,
                        (*fields.namebuf || qfl->qf_directory != NULL)
                            ? fields.namebuf
***************
*** 1808,1814 ****
      static qf_list_T *
  qf_get_curlist(qf_info_T *qi)
  {
!     return &qi->qf_lists[qi->qf_curlist];
  }
  
  /*
--- 1810,1816 ----
      static qf_list_T *
  qf_get_curlist(qf_info_T *qi)
  {
!     return qf_get_list(qi, qi->qf_curlist);
  }
  
  /*
***************
*** 1924,1930 ****
        wipe_qf_buffer(qi);
  
        for (i = 0; i < qi->qf_listcount; ++i)
!           qf_free(&qi->qf_lists[i]);
        vim_free(qi);
      }
  }
--- 1926,1932 ----
        wipe_qf_buffer(qi);
  
        for (i = 0; i < qi->qf_listcount; ++i)
!           qf_free(qf_get_list(qi, i));
        vim_free(qi);
      }
  }
***************
*** 1947,1953 ****
      else
        // quickfix list
        for (i = 0; i < qi->qf_listcount; ++i)
!           qf_free(&qi->qf_lists[i]);
  }
  
  /*
--- 1949,1955 ----
      else
        // quickfix list
        for (i = 0; i < qi->qf_listcount; ++i)
!           qf_free(qf_get_list(qi, i));
  }
  
  /*
***************
*** 2010,2017 ****
   */
      static int
  qf_add_entry(
!     qf_info_T *qi,            // quickfix list
!     int               qf_idx,         // list index
      char_u    *dir,           // optional directory name
      char_u    *fname,         // file name or NULL
      char_u    *module,        // module name or NULL
--- 2012,2018 ----
   */
      static int
  qf_add_entry(
!     qf_list_T *qfl,           // quickfix list entry
      char_u    *dir,           // optional directory name
      char_u    *fname,         // file name or NULL
      char_u    *module,        // module name or NULL
***************
*** 2025,2031 ****
      int               type,           // type character
      int               valid)          // valid entry
  {
-     qf_list_T *qfl = &qi->qf_lists[qf_idx];
      qfline_T  *qfp;
      qfline_T  **lastp;        // pointer to qf_last or NULL
  
--- 2026,2031 ----
***************
*** 2041,2047 ****
                IS_QF_LIST(qfl) ? BUF_HAS_QF_ENTRY : BUF_HAS_LL_ENTRY;
      }
      else
!       qfp->qf_fnum = qf_get_fnum(qi, qf_idx, dir, fname);
      if ((qfp->qf_text = vim_strsave(mesg)) == NULL)
      {
        vim_free(qfp);
--- 2041,2047 ----
                IS_QF_LIST(qfl) ? BUF_HAS_QF_ENTRY : BUF_HAS_LL_ENTRY;
      }
      else
!       qfp->qf_fnum = qf_get_fnum(qfl, dir, fname);
      if ((qfp->qf_text = vim_strsave(mesg)) == NULL)
      {
        vim_free(qfp);
***************
*** 2074,2080 ****
      qfp->qf_valid = valid;
  
      lastp = &qfl->qf_last;
!     if (qf_list_empty(qi, qf_idx))    // first element in the list
      {
        qfl->qf_start = qfp;
        qfl->qf_ptr = qfp;
--- 2074,2080 ----
      qfp->qf_valid = valid;
  
      lastp = &qfl->qf_last;
!     if (qf_list_empty(qfl))           // first element in the list
      {
        qfl->qf_start = qfp;
        qfl->qf_ptr = qfp;
***************
*** 2141,2147 ****
   * Copy location list entries from 'from_qfl' to 'to_qfl'.
   */
      static int
! copy_loclist_entries(qf_list_T *from_qfl, qf_list_T *to_qfl, qf_info_T *to_qi)
  {
      int               i;
      qfline_T    *from_qfp;
--- 2141,2147 ----
   * Copy location list entries from 'from_qfl' to 'to_qfl'.
   */
      static int
! copy_loclist_entries(qf_list_T *from_qfl, qf_list_T *to_qfl)
  {
      int               i;
      qfline_T    *from_qfp;
***************
*** 2152,2159 ****
            i < from_qfl->qf_count && from_qfp != NULL;
            ++i, from_qfp = from_qfp->qf_next)
      {
!       if (qf_add_entry(to_qi,
!                   to_qi->qf_curlist,
                    NULL,
                    NULL,
                    from_qfp->qf_module,
--- 2152,2158 ----
            i < from_qfl->qf_count && from_qfp != NULL;
            ++i, from_qfp = from_qfp->qf_next)
      {
!       if (qf_add_entry(to_qfl,
                    NULL,
                    NULL,
                    from_qfp->qf_module,
***************
*** 2185,2191 ****
   * Copy the specified location list 'from_qfl' to 'to_qfl'.
   */
      static int
! copy_loclist(qf_list_T *from_qfl, qf_list_T *to_qfl, qf_info_T *to_qi)
  {
      // Some of the fields are populated by qf_add_entry()
      to_qfl->qfl_type = from_qfl->qfl_type;
--- 2184,2190 ----
   * Copy the specified location list 'from_qfl' to 'to_qfl'.
   */
      static int
! copy_loclist(qf_list_T *from_qfl, qf_list_T *to_qfl)
  {
      // Some of the fields are populated by qf_add_entry()
      to_qfl->qfl_type = from_qfl->qfl_type;
***************
*** 2209,2215 ****
        to_qfl->qf_ctx = NULL;
  
      if (from_qfl->qf_count)
!       if (copy_loclist_entries(from_qfl, to_qfl, to_qi) == FAIL)
            return FAIL;
  
      to_qfl->qf_index = from_qfl->qf_index;    // current index in the list
--- 2208,2214 ----
        to_qfl->qf_ctx = NULL;
  
      if (from_qfl->qf_count)
!       if (copy_loclist_entries(from_qfl, to_qfl) == FAIL)
            return FAIL;
  
      to_qfl->qf_index = from_qfl->qf_index;    // current index in the list
***************
*** 2260,2267 ****
      {
        to->w_llist->qf_curlist = idx;
  
!       if (copy_loclist(&qi->qf_lists[idx],
!                       &to->w_llist->qf_lists[idx], to->w_llist) == FAIL)
        {
            qf_free_all(to);
            return;
--- 2259,2266 ----
      {
        to->w_llist->qf_curlist = idx;
  
!       if (copy_loclist(qf_get_list(qi, idx),
!                       qf_get_list(to->w_llist, idx)) == FAIL)
        {
            qf_free_all(to);
            return;
***************
*** 2276,2284 ****
   * Also sets the b_has_qf_entry flag.
   */
      static int
! qf_get_fnum(qf_info_T *qi, int qf_idx, char_u *directory, char_u *fname)
  {
-     qf_list_T *qfl = &qi->qf_lists[qf_idx];
      char_u    *ptr = NULL;
      buf_T     *buf;
      char_u    *bufname;
--- 2275,2282 ----
   * Also sets the b_has_qf_entry flag.
   */
      static int
! qf_get_fnum(qf_list_T *qfl, char_u *directory, char_u *fname)
  {
      char_u    *ptr = NULL;
      buf_T     *buf;
      char_u    *bufname;
***************
*** 2906,2912 ****
  
      // If the location list for the window is not set, then set it
      // to the location list from the location window
!     if (win->w_llist == NULL)
        win_set_loclist(win, ll_ref);
  }
  
--- 2904,2910 ----
  
      // If the location list for the window is not set, then set it
      // to the location list from the location window
!     if (win->w_llist == NULL && ll_ref != NULL)
        win_set_loclist(win, ll_ref);
  }
  
***************
*** 3312,3318 ****
      if (qi == NULL)
        qi = &ql_info;
  
!     if (qf_stack_empty(qi) || qf_list_empty(qi, qi->qf_curlist))
      {
        emsg(_(e_quickfix));
        return;
--- 3310,3316 ----
      if (qi == NULL)
        qi = &ql_info;
  
!     if (qf_stack_empty(qi) || qf_list_empty(qf_get_curlist(qi)))
      {
        emsg(_(e_quickfix));
        return;
***************
*** 3506,3512 ****
        }
      }
  
!     if (qf_stack_empty(qi) || qf_list_empty(qi, qi->qf_curlist))
      {
        emsg(_(e_quickfix));
        return;
--- 3504,3510 ----
        }
      }
  
!     if (qf_stack_empty(qi) || qf_list_empty(qf_get_curlist(qi)))
      {
        emsg(_(e_quickfix));
        return;
***************
*** 3790,3798 ****
      }
  
      for (idx = 0; idx < qi->qf_listcount; ++idx)
!       if (!qf_list_empty(qi, idx))
!           for (i = 0, qfp = qi->qf_lists[idx].qf_start;
!                       i < qi->qf_lists[idx].qf_count && qfp != NULL;
                        ++i, qfp = qfp->qf_next)
                if (qfp->qf_fnum == curbuf->b_fnum)
                {
--- 3788,3799 ----
      }
  
      for (idx = 0; idx < qi->qf_listcount; ++idx)
!     {
!       qf_list_T       *qfl = qf_get_list(qi, idx);
! 
!       if (!qf_list_empty(qfl))
!           for (i = 0, qfp = qfl->qf_start;
!                       i < qfl->qf_count && qfp != NULL;
                        ++i, qfp = qfp->qf_next)
                if (qfp->qf_fnum == curbuf->b_fnum)
                {
***************
*** 3807,3812 ****
--- 3808,3814 ----
                    else if (amount_after && qfp->qf_lnum > line2)
                        qfp->qf_lnum += amount_after;
                }
+     }
  
      if (!found_one)
        curbuf->b_has_qf_entry &= ~buf_has_flag;
***************
*** 3872,3878 ****
      if (IS_LL_WINDOW(curwin))
        qi = GET_LOC_LIST(curwin);
  
!     if (qf_list_empty(qi, qi->qf_curlist))
      {
        emsg(_(e_quickfix));
        return;
--- 3874,3880 ----
      if (IS_LL_WINDOW(curwin))
        qi = GET_LOC_LIST(curwin);
  
!     if (qf_list_empty(qf_get_curlist(qi)))
      {
        emsg(_(e_quickfix));
        return;
***************
*** 3919,3925 ****
      // it if we have errors; otherwise, leave it closed.
      if (qf_stack_empty(qi)
            || qfl->qf_nonevalid
!           || qf_list_empty(qi, qi->qf_curlist))
      {
        if (win != NULL)
            ex_cclose(eap);
--- 3921,3927 ----
      // it if we have errors; otherwise, leave it closed.
      if (qf_stack_empty(qi)
            || qfl->qf_nonevalid
!           || qf_list_empty(qf_get_curlist(qi)))
      {
        if (win != NULL)
            ex_cclose(eap);
***************
*** 4580,4586 ****
        return;
  
      // Autocommands might have cleared the list, check for that.
!     if (!qf_list_empty(qi, qi->qf_curlist))
        qf_jump(qi, 0, 0, forceit);
  }
  
--- 4582,4588 ----
        return;
  
      // Autocommands might have cleared the list, check for that.
!     if (!qf_list_empty(qf_get_curlist(qi)))
        qf_jump(qi, 0, 0, forceit);
  }
  
***************
*** 5305,5312 ****
            // Pass the buffer number so that it gets used even for a
            // dummy buffer, unless duplicate_name is set, then the
            // buffer will be wiped out below.
!           if (qf_add_entry(qi,
!                       qi->qf_curlist,
                        NULL,       // dir
                        fname,
                        NULL,
--- 5307,5313 ----
            // Pass the buffer number so that it gets used even for a
            // dummy buffer, unless duplicate_name is set, then the
            // buffer will be wiped out below.
!           if (qf_add_entry(qf_get_curlist(qi),
                        NULL,       // dir
                        fname,
                        NULL,
***************
*** 5624,5630 ****
      }
  
      // Jump to first match.
!     if (!qf_list_empty(qi, qi->qf_curlist))
      {
        if ((flags & VGR_NOJUMP) == 0)
            vgr_jump_to_match(qi, eap->forceit, &redraw_for_dummy,
--- 5625,5631 ----
      }
  
      // Jump to first match.
!     if (!qf_list_empty(qf_get_curlist(qi)))
      {
        if ((flags & VGR_NOJUMP) == 0)
            vgr_jump_to_match(qi, eap->forceit, &redraw_for_dummy,
***************
*** 5837,5842 ****
--- 5838,5844 ----
  get_errorlist(qf_info_T *qi_arg, win_T *wp, int qf_idx, list_T *list)
  {
      qf_info_T *qi = qi_arg;
+     qf_list_T *qfl;
      dict_T    *dict;
      char_u    buf[2];
      qfline_T  *qfp;
***************
*** 5857,5867 ****
      if (qf_idx == INVALID_QFIDX)
        qf_idx = qi->qf_curlist;
  
!     if (qf_idx >= qi->qf_listcount || qf_list_empty(qi, qf_idx))
        return FAIL;
  
!     qfp = qi->qf_lists[qf_idx].qf_start;
!     for (i = 1; !got_int && i <= qi->qf_lists[qf_idx].qf_count; ++i)
      {
        // Handle entries with a non-existing buffer number.
        bufnum = qfp->qf_fnum;
--- 5859,5873 ----
      if (qf_idx == INVALID_QFIDX)
        qf_idx = qi->qf_curlist;
  
!     if (qf_idx >= qi->qf_listcount)
!       return FAIL;
! 
!     qfl = qf_get_list(qi, qf_idx);
!     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.
        bufnum = qfp->qf_fnum;
***************
*** 6215,6224 ****
   * Return the current quickfix list index as 'idx' in retdict
   */
      static int
! qf_getprop_idx(qf_info_T *qi, int qf_idx, dict_T *retdict)
  {
!     int curidx = qi->qf_lists[qf_idx].qf_index;
!     if (qf_list_empty(qi, qf_idx))
        // For empty lists, current index is set to 0
        curidx = 0;
      return dict_add_number(retdict, "idx", curidx);
--- 6221,6230 ----
   * Return the current quickfix list index as 'idx' in retdict
   */
      static int
! qf_getprop_idx(qf_list_T *qfl, dict_T *retdict)
  {
!     int curidx = qfl->qf_index;
!     if (qf_list_empty(qfl))
        // For empty lists, current index is set to 0
        curidx = 0;
      return dict_add_number(retdict, "idx", curidx);
***************
*** 6254,6260 ****
      if (qf_stack_empty(qi) || qf_idx == INVALID_QFIDX)
        return qf_getprop_defaults(qi, flags, wp != NULL, retdict);
  
!     qfl = &qi->qf_lists[qf_idx];
  
      if (flags & QF_GETLIST_TITLE)
        status = qf_getprop_title(qfl, retdict);
--- 6260,6266 ----
      if (qf_stack_empty(qi) || qf_idx == INVALID_QFIDX)
        return qf_getprop_defaults(qi, flags, wp != NULL, retdict);
  
!     qfl = qf_get_list(qi, qf_idx);
  
      if (flags & QF_GETLIST_TITLE)
        status = qf_getprop_title(qfl, retdict);
***************
*** 6269,6275 ****
      if ((status == OK) && (flags & QF_GETLIST_ID))
        status = dict_add_number(retdict, "id", qfl->qf_id);
      if ((status == OK) && (flags & QF_GETLIST_IDX))
!       status = qf_getprop_idx(qi, qf_idx, retdict);
      if ((status == OK) && (flags & QF_GETLIST_SIZE))
        status = dict_add_number(retdict, "size", qfl->qf_count);
      if ((status == OK) && (flags & QF_GETLIST_TICK))
--- 6275,6281 ----
      if ((status == OK) && (flags & QF_GETLIST_ID))
        status = dict_add_number(retdict, "id", qfl->qf_id);
      if ((status == OK) && (flags & QF_GETLIST_IDX))
!       status = qf_getprop_idx(qfl, retdict);
      if ((status == OK) && (flags & QF_GETLIST_SIZE))
        status = dict_add_number(retdict, "size", qfl->qf_count);
      if ((status == OK) && (flags & QF_GETLIST_TICK))
***************
*** 6289,6296 ****
   */
      static int
  qf_add_entry_from_dict(
!       qf_info_T       *qi,
!       int             qf_idx,
        dict_T          *d,
        int             first_entry,
        int             *valid_entry)
--- 6295,6301 ----
   */
      static int
  qf_add_entry_from_dict(
!       qf_list_T       *qfl,
        dict_T          *d,
        int             first_entry,
        int             *valid_entry)
***************
*** 6337,6344 ****
      if ((dict_find(d, (char_u *)"valid", -1)) != NULL)
        valid = (int)dict_get_number(d, (char_u *)"valid");
  
!     status =  qf_add_entry(qi,
!                       qf_idx,
                        NULL,           // dir
                        filename,
                        module,
--- 6342,6348 ----
      if ((dict_find(d, (char_u *)"valid", -1)) != NULL)
        valid = (int)dict_get_number(d, (char_u *)"valid");
  
!     status =  qf_add_entry(qfl,
                        NULL,           // dir
                        filename,
                        module,
***************
*** 6376,6382 ****
        char_u          *title,
        int             action)
  {
!     qf_list_T *qfl = &qi->qf_lists[qf_idx];
      listitem_T        *li;
      dict_T    *d;
      qfline_T  *old_last = NULL;
--- 6380,6386 ----
        char_u          *title,
        int             action)
  {
!     qf_list_T *qfl = qf_get_list(qi, qf_idx);
      listitem_T        *li;
      dict_T    *d;
      qfline_T  *old_last = NULL;
***************
*** 6388,6396 ****
        // make place for a new list
        qf_new_list(qi, title);
        qf_idx = qi->qf_curlist;
!       qfl = &qi->qf_lists[qf_idx];
      }
!     else if (action == 'a' && !qf_list_empty(qi, qf_idx))
        // Adding to existing list, use last entry.
        old_last = qfl->qf_last;
      else if (action == 'r')
--- 6392,6400 ----
        // make place for a new list
        qf_new_list(qi, title);
        qf_idx = qi->qf_curlist;
!       qfl = qf_get_list(qi, qf_idx);
      }
!     else if (action == 'a' && !qf_list_empty(qfl))
        // Adding to existing list, use last entry.
        old_last = qfl->qf_last;
      else if (action == 'r')
***************
*** 6408,6414 ****
        if (d == NULL)
            continue;
  
!       retval = qf_add_entry_from_dict(qi, qf_idx, d, li == list->lv_first,
                                                                &valid_entry);
        if (retval == FAIL)
            break;
--- 6412,6418 ----
        if (d == NULL)
            continue;
  
!       retval = qf_add_entry_from_dict(qfl, d, li == list->lv_first,
                                                                &valid_entry);
        if (retval == FAIL)
            break;
***************
*** 6427,6433 ****
  
      // Update the current error index if not appending to the list or if the
      // list was empty before and it is not empty now.
!     if ((action != 'a' || qfl->qf_index == 0) && !qf_list_empty(qi, qf_idx))
        qfl->qf_index = 1;
  
      // Don't update the cursor in quickfix window when appending entries
--- 6431,6437 ----
  
      // Update the current error index if not appending to the list or if the
      // list was empty before and it is not empty now.
!     if ((action != 'a' || qfl->qf_index == 0) && !qf_list_empty(qfl))
        qfl->qf_index = 1;
  
      // Don't update the cursor in quickfix window when appending entries
***************
*** 6504,6510 ****
      static int
  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];
  
      if (di->di_tv.v_type != VAR_STRING)
        return FAIL;
--- 6508,6514 ----
      static int
  qf_setprop_title(qf_info_T *qi, int qf_idx, dict_T *what, dictitem_T *di)
  {
!     qf_list_T *qfl = qf_get_list(qi, qf_idx);
  
      if (di->di_tv.v_type != VAR_STRING)
        return FAIL;
***************
*** 6663,6669 ****
        qf_idx = qi->qf_curlist;
      }
  
!     qfl = &qi->qf_lists[qf_idx];
      if ((di = dict_find(what, (char_u *)"title", -1)) != NULL)
        retval = qf_setprop_title(qi, qf_idx, what, di);
      if ((di = dict_find(what, (char_u *)"items", -1)) != NULL)
--- 6667,6673 ----
        qf_idx = qi->qf_curlist;
      }
  
!     qfl = qf_get_list(qi, qf_idx);
      if ((di = dict_find(what, (char_u *)"title", -1)) != NULL)
        retval = qf_setprop_title(qi, qf_idx, what, di);
      if ((di = dict_find(what, (char_u *)"items", -1)) != NULL)
***************
*** 7113,7120 ****
            while (l > 0 && line[l - 1] <= ' ')
                line[--l] = NUL;
  
!           if (qf_add_entry(qi,
!                       qi->qf_curlist,
                        NULL,   // dir
                        fname,
                        NULL,
--- 7117,7123 ----
            while (l > 0 && line[l - 1] <= ' ')
                line[--l] = NUL;
  
!           if (qf_add_entry(qf_get_curlist(qi),
                        NULL,   // dir
                        fname,
                        NULL,
***************
*** 7310,7316 ****
      }
  
      // Jump to first match.
!     if (!qf_list_empty(qi, qi->qf_curlist))
        qf_jump(qi, 0, 0, FALSE);
      else
        semsg(_(e_nomatch2), eap->arg);
--- 7313,7319 ----
      }
  
      // Jump to first match.
!     if (!qf_list_empty(qf_get_curlist(qi)))
        qf_jump(qi, 0, 0, FALSE);
      else
        semsg(_(e_nomatch2), eap->arg);
*** ../vim-8.1.1029/src/version.c       2019-03-21 20:50:08.868741864 +0100
--- src/version.c       2019-03-21 21:11:51.083222658 +0100
***************
*** 781,782 ****
--- 781,784 ----
  {   /* Add new patch number below this line */
+ /**/
+     1030,
  /**/

-- 
I AM THANKFUL...
...for the taxes that I pay because it means that I am employed.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui