home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / 7.3.756 < prev    next >
Encoding:
Internet Message Format  |  2012-12-11  |  2.9 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.756
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.756
  11. Problem:    A location list can get a wrong count in :lvimgrep.
  12. Solution:   Check if the list was changed by autocommands. (mostly by
  13.         Christian Brabandt)
  14. Files:        src/quickfic.c
  15.  
  16.  
  17. *** ../vim-7.3.755/src/quickfix.c    2012-12-05 15:16:42.000000000 +0100
  18. --- src/quickfix.c    2012-12-12 15:50:08.000000000 +0100
  19. ***************
  20. *** 3109,3114 ****
  21. --- 3109,3117 ----
  22.       char_u    *p;
  23.       int        fi;
  24.       qf_info_T    *qi = &ql_info;
  25. + #ifdef FEAT_AUTOCMD
  26. +     qfline_T    *cur_qf_start;
  27. + #endif
  28.       qfline_T    *prevp = NULL;
  29.       long    lnum;
  30.       buf_T    *buf;
  31. ***************
  32. *** 3218,3223 ****
  33. --- 3221,3232 ----
  34.        * ":lcd %:p:h" changes the meaning of short path names. */
  35.       mch_dirname(dirname_start, MAXPATHL);
  36.   
  37. + #ifdef FEAT_AUTOCMD
  38. +      /* Remeber the value of qf_start, so that we can check for autocommands
  39. +       * changing the current quickfix list. */
  40. +     cur_qf_start = qi->qf_lists[qi->qf_curlist].qf_start;
  41. + #endif
  42.       seconds = (time_t)0;
  43.       for (fi = 0; fi < fcount && !got_int && tomatch > 0; ++fi)
  44.       {
  45. ***************
  46. *** 3273,3278 ****
  47. --- 3282,3309 ----
  48.           /* Use existing, loaded buffer. */
  49.           using_dummy = FALSE;
  50.   
  51. + #ifdef FEAT_AUTOCMD
  52. +     if (cur_qf_start != qi->qf_lists[qi->qf_curlist].qf_start)
  53. +     {
  54. +         int idx;
  55. +         /* Autocommands changed the quickfix list.  Find the one we were
  56. +          * using and restore it. */
  57. +         for (idx = 0; idx < LISTCOUNT; ++idx)
  58. +         if (cur_qf_start == qi->qf_lists[idx].qf_start)
  59. +         {
  60. +             qi->qf_curlist = idx;
  61. +             break;
  62. +         }
  63. +         if (idx == LISTCOUNT)
  64. +         {
  65. +         /* List cannot be found, create a new one. */
  66. +         qf_new_list(qi, *eap->cmdlinep);
  67. +         cur_qf_start = qi->qf_lists[qi->qf_curlist].qf_start;
  68. +         }
  69. +     }
  70. + #endif
  71.       if (buf == NULL)
  72.       {
  73.           if (!got_int)
  74. ***************
  75. *** 3324,3329 ****
  76. --- 3355,3363 ----
  77.           if (got_int)
  78.               break;
  79.           }
  80. + #ifdef FEAT_AUTOCMD
  81. +         cur_qf_start = qi->qf_lists[qi->qf_curlist].qf_start;
  82. + #endif
  83.   
  84.           if (using_dummy)
  85.           {
  86. *** ../vim-7.3.755/src/version.c    2012-12-12 14:25:01.000000000 +0100
  87. --- src/version.c    2012-12-12 15:35:58.000000000 +0100
  88. ***************
  89. *** 727,728 ****
  90. --- 727,730 ----
  91.   {   /* Add new patch number below this line */
  92. + /**/
  93. +     756,
  94.   /**/
  95.  
  96. -- 
  97. hundred-and-one symptoms of being an internet addict:
  98. 146. You experience ACTUAL physical withdrawal symptoms when away
  99.      from your 'puter and the net.
  100.  
  101.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  102. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  103. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  104.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  105.