You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's take {trigger: "sum", replacement: "\\sum", options: "mA"} as an example.
For me, it's difficult to be consistent enough to refrain from typing \sum instead of just sum.
Most of the time I type just sum, but sometimes I carelessly type \sum, which results in double backslashes, i.e. \\sum.
Description of the Solution
It would be great if this plugin had the option to disable replacement when there is already a backslash so that the result will be \sum regardless of whether I typed the backslash or not.
Additional
I could partially resolve this problem by replacing the snippet with {trigger: "[^\\\\]sum", replacement: "\\sum", options: "rmA"} but it inserts \sum at an unexpected position:
Screen.Recording.2023-09-27.at.18.42.19.mov
The text was updated successfully, but these errors were encountered:
As for the last point, {trigger: "([^\\\\])sum", replacement: "[[0]]\\sum", options: "rmA"} solved the issue.
But doing this for all snippets will be hard work, given the variety of the snippets (such as tabstops).
For example, the same problem applies to {trigger: "int", replacement: "\\int $0 \\, d${1:x} $2", options: "mA"} as well.
That's a good example... I said a snippet should be disabled for \sum, but now I've realized it's not perfect.
So let me correct myself: if double backslashes \\ are detected at the starting position of the result after trigger is replaced by replacement, then they should be replaced with a single backslash \.
In other words, sum and \sum should give the same result.
Hi, thank you so much for this great plugin!
Description of the Problem
Let's take
{trigger: "sum", replacement: "\\sum", options: "mA"}
as an example.For me, it's difficult to be consistent enough to refrain from typing
\sum
instead of justsum
.Most of the time I type just
sum
, but sometimes I carelessly type\sum
, which results in double backslashes, i.e.\\sum
.Description of the Solution
It would be great if this plugin had the option to disable replacement when there is already a backslash so that the result will be
\sum
regardless of whether I typed the backslash or not.Additional
I could partially resolve this problem by replacing the snippet with
{trigger: "[^\\\\]sum", replacement: "\\sum", options: "rmA"}
but it inserts\sum
at an unexpected position:Screen.Recording.2023-09-27.at.18.42.19.mov
The text was updated successfully, but these errors were encountered: