Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants