[vim/vim] 9c0d057e3 breaks viewing a bash ~/.profile when &re=1 (Issue #19847)

7 views
Skip to first unread message

chdiza

unread,
Mar 27, 2026, 10:43:37 AM (18 hours ago) Mar 27
to vim/vim, Subscribed
chdiza created an issue (vim/vim#19847)

Steps to reproduce

Do vim .profile in my $HOME, when the vimrc contains only the following two lines: se re=1 and syn enable. The bash profile is only 139 lines long, with no funny business.

Since the mentioned commit, it takes a few seconds to open, and when it finally does, I see redrawtime exceeded, syntax highlighting disabled at the bottom of the window (and of course, no syntax highlighting.)

There is no issue if I comment-out se re=1. But I don't think something as fundamental as shell highlighting should depend on the backtracking engine.

Expected behaviour

It should open instantly and with syntax highlighting working, as it has for the last 21 years.

Version of Vim

9.2.0239 with 9c0d057

Environment

Linux Mint 22
Terminal: kitty (but the problem also happens in gvim).

Logs and stack traces


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19847@github.com>

Christian Brabandt

unread,
Mar 27, 2026, 11:29:46 AM (18 hours ago) Mar 27
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19847)

can you please use :syntime and find the offending regex?


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19847/4143426636@github.com>

chdiza

unread,
Mar 27, 2026, 1:18:19 PM (16 hours ago) Mar 27
to vim/vim, Subscribed
chdiza left a comment (vim/vim#19847)

Sure. There's a clear culprit:

  TOTAL      COUNT  MATCH   SLOWEST     AVERAGE   NAME               PATTERN
  2.000360390 1     0       2.000360390   2.000360390 shFunctionThree ^\s*\zs\%(\<\k\+\|[^()<>|&$;\t ]\+\)\+\s*()\ze\_s*((\@!

Let me know if you want the whole :syntime report. But all other lines have a time starting with 0.000000.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19847/4144089015@github.com>

Aliaksei Budavei

unread,
Mar 27, 2026, 4:15:13 PM (13 hours ago) Mar 27
to vim/vim, Subscribed
zzzyxwvut left a comment (vim/vim#19847)

Sorry about this regression.

Although the identified pattern follows closely what may
qualify as a function name according to the manual page:

In default mode, a function name can be any unquoted shell
word that does not contain $.

I concede that the name part needs more reining in to avoid
wasting time on non-matching candidates. I'll offer a fix
in a little bit.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19847/4145005742@github.com>

Christian Brabandt

unread,
Mar 27, 2026, 4:30:13 PM (13 hours ago) Mar 27
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19847)

Perhaps we can just limit the look around assertion by say 30 bytes?


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19847/4145076699@github.com>

Reply all
Reply to author
Forward
0 new messages