Skip to content
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

Do not autoclose $ after an escaping slash #440

Open
Trebor-Huang opened this issue Mar 2, 2024 · 1 comment
Open

Do not autoclose $ after an escaping slash #440

Trebor-Huang opened this issue Mar 2, 2024 · 1 comment

Comments

@Trebor-Huang
Copy link

Trebor-Huang commented Mar 2, 2024

Currently the autoclosing pairs in the VSCode language configuration lists $ and $. This is slightly annoying when dealing with money. Is this possible with the language configuration alone? A quick glance at the documentation suggests that it is unlikely. We might perhaps achieve this by hacking the notIn option, putting the character behind a backslash in a comment region.

Another way might be to declare "\$" and "" as an autoclosing pair. I haven't tested whether it works, but it does behave correctly when dealing with \( and ( simultaneously in TeX language configurations, so maybe it's worth a try.

@Myriad-Dreamin
Copy link
Collaborator

Myriad-Dreamin commented Mar 5, 2024

It is not easy to get fixed in language configuration.

To fix it, we can remove the auto-closing $ pair from language configuration and handle it by some customized handler, like https://github.com/CFiggers/typst-companion/blob/main/src/listEditing.ts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants