1
0
forked from aniani/vim

updated for version 7.4.290

Problem:    A non-greedy match followed by a branch is too greedy. (Ingo
            Karkat)
Solution:   Add NFA_MATCH when it is already in the state list if the position
            differs.
This commit is contained in:
Bram Moolenaar
2014-05-13 16:44:29 +02:00
parent ee4825331a
commit 9c235069b2
4 changed files with 28 additions and 8 deletions

View File

@@ -4324,8 +4324,10 @@ addstate(l, state, subs_arg, pim, off)
{
/* This state is already in the list, don't add it again,
* unless it is an MOPEN that is used for a backreference or
* when there is a PIM. */
if (!nfa_has_backref && pim == NULL && !l->has_pim)
* when there is a PIM. For NFA_MATCH check the position,
* lower position is preferred. */
if (!nfa_has_backref && pim == NULL && !l->has_pim
&& state->c != NFA_MATCH)
{
skip_add:
#ifdef ENABLE_LOG