Open ces42 opened 2 months ago
Thanks! That's definitely an edge case! The reason for this is here:
I.e., I've specified a maximum number of "iterations" in the loop that looks for the correct surrounding delimiters/environment. And at some time, ages ago, I found that this search was slow for math delimiters because there are many of them and the regexes are quite complex. So, I decided to use a very strict and low maximum number here.
It may definitely be possible to relax this. I believe it could be safe and that I may have been a little bit too conservative here. But I don't want to change it much, and if someone complains that VimTeX is suddenly more laggy I would not hesitate to revert such a change. What do you think?
See also #2432; this is where the strict current setting was motivated and added.
Description
I stumbled upon this strange bug. It seems to be very rare so rather low-priority. I can try to look into what's happening once I'm less busy...
Steps to reproduce
put this into a tex file
move the cursor to y and do
ts$
Expected behavior
\[ ... \]
should turn to\begin{equation} ... \end{equation}
Actual behavior
nothing happens. If the cursor is in the first line of the displaymath everything seems to work fine. If I delete the
$3$
things also work fine.Do you use a latexmkrc file?
no
VimtexInfo