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