073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.344
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.344
073263
Problem:    Unessecary initializations and other things related to
073263
	    matchaddpos().
073263
Solution:   Code cleanup. (Alexey Radkov)
073263
Files:	    runtime/doc/eval.txt, src/screen.c, src/window.c
073263
073263
073263
*** ../vim-7.4.343/runtime/doc/eval.txt	2014-06-25 17:31:04.934737863 +0200
073263
--- runtime/doc/eval.txt	2014-06-25 18:08:50.790823583 +0200
073263
***************
073263
*** 4353,4369 ****
073263
  		required, for example to highlight matching parentheses.
073263
  
073263
  		The list {pos} can contain one of these items:
073263
! 		- A number.  This while line will be highlighted.  The first
073263
  		  line has number 1.
073263
  		- A list with one number, e.g., [23]. The whole line with this
073263
  		  number will be highlighted.
073263
  		- A list with two numbers, e.g., [23, 11]. The first number is
073263
! 		  the line number, the second one the column number (first
073263
! 		  column is 1).  The character at this position will be
073263
! 		  highlighted.
073263
  		- A list with three numbers, e.g., [23, 11, 3]. As above, but
073263
! 		  the third number gives the length of the highlight in screen
073263
! 		  cells.
073263
  		
073263
  		The maximum number of positions is 8.
073263
  
073263
--- 4391,4407 ----
073263
  		required, for example to highlight matching parentheses.
073263
  
073263
  		The list {pos} can contain one of these items:
073263
! 		- A number.  This whole line will be highlighted.  The first
073263
  		  line has number 1.
073263
  		- A list with one number, e.g., [23]. The whole line with this
073263
  		  number will be highlighted.
073263
  		- A list with two numbers, e.g., [23, 11]. The first number is
073263
! 		  the line number, the second one is the column number (first
073263
! 		  column is 1, the value must correspond to the byte index as
073263
! 		  |col()| would return).  The character at this position will
073263
! 		  be highlighted.
073263
  		- A list with three numbers, e.g., [23, 11, 3]. As above, but
073263
! 		  the third number gives the length of the highlight in bytes.
073263
  		
073263
  		The maximum number of positions is 8.
073263
  
073263
*** ../vim-7.4.343/src/screen.c	2014-06-25 14:39:35.110348584 +0200
073263
--- src/screen.c	2014-06-25 18:10:11.906826652 +0200
073263
***************
073263
*** 7531,7537 ****
073263
      colnr_T	    mincol;	/* minimal column for a match */
073263
  {
073263
      int	    i;
073263
!     int     bot = -1;
073263
  
073263
      shl->lnum = 0;
073263
      for (i = posmatch->cur; i < MAXPOSMATCH; i++)
073263
--- 7531,7537 ----
073263
      colnr_T	    mincol;	/* minimal column for a match */
073263
  {
073263
      int	    i;
073263
!     int	    bot = -1;
073263
  
073263
      shl->lnum = 0;
073263
      for (i = posmatch->cur; i < MAXPOSMATCH; i++)
073263
*** ../vim-7.4.343/src/window.c	2014-06-25 17:58:07.346799241 +0200
073263
--- src/window.c	2014-06-25 18:10:45.698827930 +0200
073263
***************
073263
*** 6813,6819 ****
073263
      m->id = id;
073263
      m->priority = prio;
073263
      m->pattern = pat == NULL ? NULL : vim_strsave(pat);
073263
-     m->pos.cur = 0;
073263
      m->hlg_id = hlg_id;
073263
      m->match.regprog = regprog;
073263
      m->match.rmm_ic = FALSE;
073263
--- 6813,6818 ----
073263
***************
073263
*** 6827,6833 ****
073263
  	listitem_T	*li;
073263
  	int		i;
073263
  
073263
! 	for (i = 0, li = pos_list->lv_first; i < MAXPOSMATCH;
073263
  							i++, li = li->li_next)
073263
  	{
073263
  	    linenr_T	lnum = 0;
073263
--- 6826,6832 ----
073263
  	listitem_T	*li;
073263
  	int		i;
073263
  
073263
! 	for (i = 0, li = pos_list->lv_first; li != NULL && i < MAXPOSMATCH;
073263
  							i++, li = li->li_next)
073263
  	{
073263
  	    linenr_T	lnum = 0;
073263
***************
073263
*** 6837,6847 ****
073263
  	    listitem_T	*subli;
073263
  	    int		error = FALSE;
073263
  
073263
- 	    if (li == NULL)
073263
- 	    {
073263
- 		m->pos.pos[i].lnum = 0;
073263
- 		break;
073263
- 	    }
073263
  	    if (li->li_tv.v_type == VAR_LIST)
073263
  	    {
073263
  		subl = li->li_tv.vval.v_list;
073263
--- 6836,6841 ----
073263
***************
073263
*** 6853,6864 ****
073263
  		lnum = get_tv_number_chk(&subli->li_tv, &error);
073263
  		if (error == TRUE)
073263
  		    goto fail;
073263
- 		m->pos.pos[i].lnum = lnum;
073263
  		if (lnum == 0)
073263
  		{
073263
  		    --i;
073263
  		    continue;
073263
  		}
073263
  		subli = subli->li_next;
073263
  		if (subli != NULL)
073263
  		{
073263
--- 6847,6858 ----
073263
  		lnum = get_tv_number_chk(&subli->li_tv, &error);
073263
  		if (error == TRUE)
073263
  		    goto fail;
073263
  		if (lnum == 0)
073263
  		{
073263
  		    --i;
073263
  		    continue;
073263
  		}
073263
+ 		m->pos.pos[i].lnum = lnum;
073263
  		subli = subli->li_next;
073263
  		if (subli != NULL)
073263
  		{
073263
***************
073263
*** 6879,6885 ****
073263
--- 6873,6882 ----
073263
  	    else if (li->li_tv.v_type == VAR_NUMBER)
073263
  	    {
073263
  		if (li->li_tv.vval.v_number == 0)
073263
+ 		{
073263
+ 		    --i;
073263
  		    continue;
073263
+ 		}
073263
  		m->pos.pos[i].lnum = li->li_tv.vval.v_number;
073263
  		m->pos.pos[i].col = 0;
073263
  		m->pos.pos[i].len = 0;
073263
*** ../vim-7.4.343/src/version.c	2014-06-25 17:58:07.346799241 +0200
073263
--- src/version.c	2014-06-25 18:07:06.170819625 +0200
073263
***************
073263
*** 736,737 ****
073263
--- 736,739 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     344,
073263
  /**/
073263
073263
-- 
073263
    [clop clop]
073263
MORTICIAN:  Who's that then?
073263
CUSTOMER:   I don't know.
073263
MORTICIAN:  Must be a king.
073263
CUSTOMER:   Why?
073263
MORTICIAN:  He hasn't got shit all over him.
073263
                                  The Quest for the Holy Grail (Monty Python)
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///