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