073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.582
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.582 (after 7.4.577)
073263
Problem:    Can't match "%>80v" properly. (Axel Bender)
073263
Solution:   Correctly handle ">". (Christian Brabandt)
073263
Files:	    src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
073263
073263
073263
*** ../vim-7.4.581/src/regexp_nfa.c	2015-01-14 18:40:23.083769507 +0100
073263
--- src/regexp_nfa.c	2015-01-18 16:38:05.437339384 +0100
073263
***************
073263
*** 6441,6456 ****
073263
  		{
073263
  		    int     op = t->state->c - NFA_VCOL;
073263
  		    colnr_T col = (colnr_T)(reginput - regline);
073263
  
073263
  		    /* Bail out quickly when there can't be a match, avoid the
073263
  		     * overhead of win_linetabsize() on long lines. */
073263
! 		    if ((col > t->state->val && op != 1)
073263
! 			    || (col - 1 > t->state->val && op == 1))
073263
  			break;
073263
! 		    result = nfa_re_num_cmp(t->state->val, op,
073263
! 			(long_u)win_linetabsize(
073263
! 				reg_win == NULL ? curwin : reg_win,
073263
! 							   regline, col) + 1);
073263
  		    if (result)
073263
  		    {
073263
  			add_here = TRUE;
073263
--- 6441,6466 ----
073263
  		{
073263
  		    int     op = t->state->c - NFA_VCOL;
073263
  		    colnr_T col = (colnr_T)(reginput - regline);
073263
+ 		    win_T   *wp = reg_win == NULL ? curwin : reg_win;
073263
  
073263
  		    /* Bail out quickly when there can't be a match, avoid the
073263
  		     * overhead of win_linetabsize() on long lines. */
073263
! 		    if (op != 1 && col > t->state->val)
073263
  			break;
073263
! 		    result = FALSE;
073263
! 		    if (op == 1 && col - 1 > t->state->val && col > 100)
073263
! 		    {
073263
! 			int ts = wp->w_buffer->b_p_ts;
073263
! 
073263
! 			/* Guess that a character won't use more columns than
073263
! 			 * 'tabstop', with a minimum of 4. */
073263
! 			if (ts < 4)
073263
! 			    ts = 4;
073263
! 			result = col > t->state->val * ts;
073263
! 		    }
073263
! 		    if (!result)
073263
! 			result = nfa_re_num_cmp(t->state->val, op,
073263
! 				(long_u)win_linetabsize(wp, regline, col) + 1);
073263
  		    if (result)
073263
  		    {
073263
  			add_here = TRUE;
073263
*** ../vim-7.4.581/src/testdir/test64.in	2014-08-29 11:56:21.350422045 +0200
073263
--- src/testdir/test64.in	2015-01-18 16:09:31.852099488 +0100
073263
***************
073263
*** 7,12 ****
073263
--- 7,13 ----
073263
  STARTTEST
073263
  :so small.vim
073263
  :" tl is a List of Lists with:
073263
+ :"    regexp engine
073263
  :"    regexp pattern
073263
  :"    text to test the pattern on
073263
  :"    expected match (optional)
073263
***************
073263
*** 451,456 ****
073263
--- 452,460 ----
073263
  :"""" Skip adding state twice
073263
  :call add(tl, [2, '^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=', "#if FOO", "#if", ' FOO'])
073263
  :"
073263
+ :""" Test \%V atom
073263
+ :call add(tl, [2, '\%>70vGesamt', 'Jean-Michel Charlier & Victor Hubinon\Gesamtausgabe [Salleck]    Buck Danny {Jean-Michel Charlier & Victor Hubinon}\Gesamtausgabe', 'Gesamt'])
073263
+ :"
073263
  :"""" Run the tests
073263
  :"
073263
  :for t in tl
073263
*** ../vim-7.4.581/src/testdir/test64.ok	2014-08-29 11:56:21.350422045 +0200
073263
--- src/testdir/test64.ok	2015-01-18 16:09:31.852099488 +0100
073263
***************
073263
*** 1030,1035 ****
073263
--- 1030,1038 ----
073263
  OK 0 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=
073263
  OK 1 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=
073263
  OK 2 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=
073263
+ OK 0 - \%>70vGesamt
073263
+ OK 1 - \%>70vGesamt
073263
+ OK 2 - \%>70vGesamt
073263
  multi-line tests
073263
  OK 0 - ^.\(.\).\_..\1.
073263
  OK 1 - ^.\(.\).\_..\1.
073263
*** ../vim-7.4.581/src/version.c	2015-01-18 14:08:52.699436994 +0100
073263
--- src/version.c	2015-01-18 16:12:32.682119256 +0100
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     582,
073263
  /**/
073263
073263
-- 
073263
There's no place like $(HOME)!
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    ///