lkundrak / rpms / vim

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