[vim/vim] submatch in a look-behind is empty with the NFA engine (PR #20805)

4 views
Skip to first unread message

h_east

unread,
Jul 21, 2026, 2:15:55 PM (16 hours ago) Jul 21
to vim/vim, Subscribed
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.
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.

fixes: #20802


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20805

Commit Summary

  • caebe5f submatch in a look-behind is empty with the NFA engine

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20805@github.com>

Christian Brabandt

unread,
4:49 AM (1 hour ago) 4:49 AM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20805)

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20805/c5043803905@github.com>

Reply all
Reply to author
Forward
0 new messages