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.4 / 7.4.344 < prev    next >
Encoding:
Internet Message Format  |  2014-06-24  |  5.2 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.344
  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.4.344
  11. Problem:    Unessecary initializations and other things related to
  12.         matchaddpos().
  13. Solution:   Code cleanup. (Alexey Radkov)
  14. Files:        runtime/doc/eval.txt, src/screen.c, src/window.c
  15.  
  16.  
  17. *** ../vim-7.4.343/runtime/doc/eval.txt    2014-06-25 17:31:04.934737863 +0200
  18. --- runtime/doc/eval.txt    2014-06-25 18:08:50.790823583 +0200
  19. ***************
  20. *** 4353,4369 ****
  21.           required, for example to highlight matching parentheses.
  22.   
  23.           The list {pos} can contain one of these items:
  24. !         - A number.  This while line will be highlighted.  The first
  25.             line has number 1.
  26.           - A list with one number, e.g., [23]. The whole line with this
  27.             number will be highlighted.
  28.           - A list with two numbers, e.g., [23, 11]. The first number is
  29. !           the line number, the second one the column number (first
  30. !           column is 1).  The character at this position will be
  31. !           highlighted.
  32.           - A list with three numbers, e.g., [23, 11, 3]. As above, but
  33. !           the third number gives the length of the highlight in screen
  34. !           cells.
  35.           
  36.           The maximum number of positions is 8.
  37.   
  38. --- 4391,4407 ----
  39.           required, for example to highlight matching parentheses.
  40.   
  41.           The list {pos} can contain one of these items:
  42. !         - A number.  This whole line will be highlighted.  The first
  43.             line has number 1.
  44.           - A list with one number, e.g., [23]. The whole line with this
  45.             number will be highlighted.
  46.           - A list with two numbers, e.g., [23, 11]. The first number is
  47. !           the line number, the second one is the column number (first
  48. !           column is 1, the value must correspond to the byte index as
  49. !           |col()| would return).  The character at this position will
  50. !           be highlighted.
  51.           - A list with three numbers, e.g., [23, 11, 3]. As above, but
  52. !           the third number gives the length of the highlight in bytes.
  53.           
  54.           The maximum number of positions is 8.
  55.   
  56. *** ../vim-7.4.343/src/screen.c    2014-06-25 14:39:35.110348584 +0200
  57. --- src/screen.c    2014-06-25 18:10:11.906826652 +0200
  58. ***************
  59. *** 7531,7537 ****
  60.       colnr_T        mincol;    /* minimal column for a match */
  61.   {
  62.       int        i;
  63. !     int     bot = -1;
  64.   
  65.       shl->lnum = 0;
  66.       for (i = posmatch->cur; i < MAXPOSMATCH; i++)
  67. --- 7531,7537 ----
  68.       colnr_T        mincol;    /* minimal column for a match */
  69.   {
  70.       int        i;
  71. !     int        bot = -1;
  72.   
  73.       shl->lnum = 0;
  74.       for (i = posmatch->cur; i < MAXPOSMATCH; i++)
  75. *** ../vim-7.4.343/src/window.c    2014-06-25 17:58:07.346799241 +0200
  76. --- src/window.c    2014-06-25 18:10:45.698827930 +0200
  77. ***************
  78. *** 6813,6819 ****
  79.       m->id = id;
  80.       m->priority = prio;
  81.       m->pattern = pat == NULL ? NULL : vim_strsave(pat);
  82. -     m->pos.cur = 0;
  83.       m->hlg_id = hlg_id;
  84.       m->match.regprog = regprog;
  85.       m->match.rmm_ic = FALSE;
  86. --- 6813,6818 ----
  87. ***************
  88. *** 6827,6833 ****
  89.       listitem_T    *li;
  90.       int        i;
  91.   
  92. !     for (i = 0, li = pos_list->lv_first; i < MAXPOSMATCH;
  93.                               i++, li = li->li_next)
  94.       {
  95.           linenr_T    lnum = 0;
  96. --- 6826,6832 ----
  97.       listitem_T    *li;
  98.       int        i;
  99.   
  100. !     for (i = 0, li = pos_list->lv_first; li != NULL && i < MAXPOSMATCH;
  101.                               i++, li = li->li_next)
  102.       {
  103.           linenr_T    lnum = 0;
  104. ***************
  105. *** 6837,6847 ****
  106.           listitem_T    *subli;
  107.           int        error = FALSE;
  108.   
  109. -         if (li == NULL)
  110. -         {
  111. -         m->pos.pos[i].lnum = 0;
  112. -         break;
  113. -         }
  114.           if (li->li_tv.v_type == VAR_LIST)
  115.           {
  116.           subl = li->li_tv.vval.v_list;
  117. --- 6836,6841 ----
  118. ***************
  119. *** 6853,6864 ****
  120.           lnum = get_tv_number_chk(&subli->li_tv, &error);
  121.           if (error == TRUE)
  122.               goto fail;
  123. -         m->pos.pos[i].lnum = lnum;
  124.           if (lnum == 0)
  125.           {
  126.               --i;
  127.               continue;
  128.           }
  129.           subli = subli->li_next;
  130.           if (subli != NULL)
  131.           {
  132. --- 6847,6858 ----
  133.           lnum = get_tv_number_chk(&subli->li_tv, &error);
  134.           if (error == TRUE)
  135.               goto fail;
  136.           if (lnum == 0)
  137.           {
  138.               --i;
  139.               continue;
  140.           }
  141. +         m->pos.pos[i].lnum = lnum;
  142.           subli = subli->li_next;
  143.           if (subli != NULL)
  144.           {
  145. ***************
  146. *** 6879,6885 ****
  147. --- 6873,6882 ----
  148.           else if (li->li_tv.v_type == VAR_NUMBER)
  149.           {
  150.           if (li->li_tv.vval.v_number == 0)
  151. +         {
  152. +             --i;
  153.               continue;
  154. +         }
  155.           m->pos.pos[i].lnum = li->li_tv.vval.v_number;
  156.           m->pos.pos[i].col = 0;
  157.           m->pos.pos[i].len = 0;
  158. *** ../vim-7.4.343/src/version.c    2014-06-25 17:58:07.346799241 +0200
  159. --- src/version.c    2014-06-25 18:07:06.170819625 +0200
  160. ***************
  161. *** 736,737 ****
  162. --- 736,739 ----
  163.   {   /* Add new patch number below this line */
  164. + /**/
  165. +     344,
  166.   /**/
  167.  
  168. -- 
  169.     [clop clop]
  170. MORTICIAN:  Who's that then?
  171. CUSTOMER:   I don't know.
  172. MORTICIAN:  Must be a king.
  173. CUSTOMER:   Why?
  174. MORTICIAN:  He hasn't got shit all over him.
  175.                                   The Quest for the Holy Grail (Monty Python)
  176.  
  177.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  178. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  179. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  180.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  181.