]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.2.0825: regexp: submatch in a look-behind is empty with the NFA engine v9.2.0825
authorHirohito Higashi <h.east.727@gmail.com>
Wed, 22 Jul 2026 08:49:26 +0000 (08:49 +0000)
committerChristian Brabandt <cb@256bit.org>
Wed, 22 Jul 2026 08:49:26 +0000 (08:49 +0000)
commitade577e4dc2a9f34d2d592cbe1c80b9fc89753bf
treeef4f5eaa1d4a090f5360b078f83a9b28b4fbc4d9
parent2262053f3225ae0f78f6d475155bab9f096ead97
patch 9.2.0825: regexp: submatch in a look-behind is empty with the NFA engine

Problem:  With the NFA engine a sub-expression inside a variable width
          look-behind, e.g. "\v(.)@<=", is empty for the first match on
          every line except the first one.  The old engine is correct
          (Mukundan)
Solution: The look-behind is retried from the previous line, because the
          width of "." is over-estimated.  While scanning that line the
          start state is added at the end of the line, where it gets the
          position of the line break as its start position, even though
          the match actually starts on the next line.  Use the position
          of the start of the next line in that case (Hirohito Higashi).

fixes:  #20802
closes: #20805

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/regexp_nfa.c
src/testdir/test_regexp_utf8.vim
src/version.c