tecosaur / LaTeX-Utilities

An add-on to LaTeX Workshop that provides some features that go beyond the bare essentials
MIT License
474 stars 28 forks source link

Fixed Live Snippet Cursor Steps out of Parentheses #385

Open josiahnross opened 1 year ago

josiahnross commented 1 year ago

Closes #384

I don't know what the purpose of the removed lines was. It seems like they were there to compensate for the additional characters added by the replacement however I found that vscode handled the cursor placement fine on its own. So instead of fixing a problem, these lines were creating an issue by moving the cursor forward after the snippet has been inserted. This often led to the cursor being moved outside of parentheses and even the math mode entirely which was quite annoying to deal with

leoleoasd commented 1 year ago

Can you make sure that this works with other snippets? As I'm not the one who wrote this, it would take me a while to figure out what this does either.

josiahnross commented 1 year ago

It works with all snippets I have tested it on which include the following (these work in a variety of math modes (inline, align environment, etc):