Closed Mq89 closed 4 years ago
The reason ist quite simple:
We want to match the text before the cursor. To do this we take the line before the cursor, reverse the text and the use re.match
to match it.
The alternative would be to write a regex like .*<the actual match>$
, which would (most likely) perform slower, because it would match over the whole line and not just the end of the line.
Thank you.
I was wondering what could be the advantage of defining a regex in reverse as in the referenced file. Can anyone shed light to this?
https://github.com/SublimeText/LaTeXTools/blob/1d93810281464a81aff9272395b90ee78225a7f5/latex_cite_completions.py#L145-L171