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