-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Live Snippet Cursor stepts out of paranthesis #384
Comments
I am experiencing the same problem. How to solve this? |
just add $$1,$$2,$$3,...,$$0 in your snippets file, which can help you put the cursor in the right place |
@Physicsphobia How do you do that exactly? I am not sure I particularly understand, very new to this. I think I just need an example (better if there is a bit of explanation). Thanks! |
@gusss1234 {
"prefix": "([^ &\\\\\\+\\-=<>\\|!~@])([\\+\\-=<>])$",
"body": "$1 $2",
"mode": "maths",
"priority": -1,
"description": "whitespace before operators",
"triggerWhenComplete": true
},
{
"prefix": "([\\+\\-=<>])([^ &\\\\\\+\\-=<>\\|!~])$",
"body": "$1 $2",
"mode": "maths",
"priority": -1,
"description": "whitespace after operators",
"triggerWhenComplete": true
}, against {
"prefix": "([^ &\\\\\\+\\-=<>\\|!~@])([\\+\\-=<>])$",
"body": "$1 $2$$1",
"mode": "maths",
"priority": -1,
"description": "whitespace before operators",
"triggerWhenComplete": true
},
{
"prefix": "([\\+\\-=<>])([^ &\\\\\\+\\-=<>\\|!~])$",
"body": "$1 $2$$1",
"mode": "maths",
"priority": -1,
"description": "whitespace after operators",
"triggerWhenComplete": true
}, Then it should work. |
@PlisJan Thanks! I think it fixed it, need to add it to everything else now since it's not the only affected by operators. This should definitely be fixed in the main codebase. |
Before that is done, I think this fixes all space problems. Beware, I deleted dot(a) and ddot(a) snippets. |
Yeah, I was having this same problem. Without looking at the code, I'm betting it has to do with VSCode not being told where to place the cursor after executing the snippet (or maybe being told to put it in the wrong place). I notice that when I have a snippet with a trigger 2 characters long which expands into 10 characters, the cursor is placed 10 - 2 = 8 characters after the end of the expansion. This definitely seems like a bug. As a temporary fix, using the guss provided above would work well. For a cleaner fix, it should probably address the issue directly. |
For another minimal example, in inline math delimiters |
Bug Report
Disable all the other extensions except for LaTeX Workshop and LaTeX Utilities, and check that you still see this issue.
You still see this issue?: Yes
Describe the bug
Live Snippet skips out of paranthesis if using +
To Reproduce
Steps to reproduce the behaviour:
align
or `equation´(a
-> vscode automatically closes the bracket ->(a)
(a+)
Expected behaviour
The cursor should stay inside the paranthesis.
Logs
Please paste the whole log messages here, not parts of ones. It is very important to identify problems. If you think the logs are unrelated, please say so.
LaTeX Workshop Output
LaTeX Utilities Output
Developer Tools Console
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop
Additional context
The text was updated successfully, but these errors were encountered: