jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/7.4.577

3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.577
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.577
3ef2ca
Problem:    Matching with a virtual column has a lot of overhead on very long
3ef2ca
	    lines. (Issue 310)
3ef2ca
Solution:   Bail out early if there can't be a match. (Christian Brabandt)
3ef2ca
	    Also check for CTRL-C at every position.
3ef2ca
Files:	    src/regexp_nfa.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.576/src/regexp_nfa.c	2014-11-23 15:57:45.568009419 +0100
3ef2ca
--- src/regexp_nfa.c	2015-01-14 18:40:12.263887756 +0100
3ef2ca
***************
3ef2ca
*** 6438,6451 ****
3ef2ca
  	    case NFA_VCOL:
3ef2ca
  	    case NFA_VCOL_GT:
3ef2ca
  	    case NFA_VCOL_LT:
3ef2ca
- 		result = nfa_re_num_cmp(t->state->val, t->state->c - NFA_VCOL,
3ef2ca
- 		    (long_u)win_linetabsize(
3ef2ca
- 			    reg_win == NULL ? curwin : reg_win,
3ef2ca
- 			    regline, (colnr_T)(reginput - regline)) + 1);
3ef2ca
- 		if (result)
3ef2ca
  		{
3ef2ca
! 		    add_here = TRUE;
3ef2ca
! 		    add_state = t->state->out;
3ef2ca
  		}
3ef2ca
  		break;
3ef2ca
  
3ef2ca
--- 6438,6461 ----
3ef2ca
  	    case NFA_VCOL:
3ef2ca
  	    case NFA_VCOL_GT:
3ef2ca
  	    case NFA_VCOL_LT:
3ef2ca
  		{
3ef2ca
! 		    int     op = t->state->c - NFA_VCOL;
3ef2ca
! 		    colnr_T col = (colnr_T)(reginput - regline);
3ef2ca
! 
3ef2ca
! 		    /* Bail out quickly when there can't be a match, avoid the
3ef2ca
! 		     * overhead of win_linetabsize() on long lines. */
3ef2ca
! 		    if ((col > t->state->val && op != 1)
3ef2ca
! 			    || (col - 1 > t->state->val && op == 1))
3ef2ca
! 			break;
3ef2ca
! 		    result = nfa_re_num_cmp(t->state->val, op,
3ef2ca
! 			(long_u)win_linetabsize(
3ef2ca
! 				reg_win == NULL ? curwin : reg_win,
3ef2ca
! 							   regline, col) + 1);
3ef2ca
! 		    if (result)
3ef2ca
! 		    {
3ef2ca
! 			add_here = TRUE;
3ef2ca
! 			add_state = t->state->out;
3ef2ca
! 		    }
3ef2ca
  		}
3ef2ca
  		break;
3ef2ca
  
3ef2ca
***************
3ef2ca
*** 6744,6749 ****
3ef2ca
--- 6754,6764 ----
3ef2ca
  	    reg_nextline();
3ef2ca
  	else
3ef2ca
  	    break;
3ef2ca
+ 
3ef2ca
+ 	/* Allow interrupting with CTRL-C. */
3ef2ca
+ 	fast_breakcheck();
3ef2ca
+ 	if (got_int)
3ef2ca
+ 	    break;
3ef2ca
      }
3ef2ca
  
3ef2ca
  #ifdef ENABLE_LOG
3ef2ca
*** ../vim-7.4.576/src/version.c	2015-01-14 17:52:26.603094340 +0100
3ef2ca
--- src/version.c	2015-01-14 18:34:10.375843602 +0100
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     577,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
From "know your smileys":
3ef2ca
 !-|	I-am-a-Cylon-Centurian-with-one-red-eye-bouncing-back-and-forth
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    ///