jamescherti/ultyas

Error in detecting math context for latex snippet

Opened this issue · 2 comments

The repository aims to facilitate the transition from Ultisnips to Yasnippet. However, I encountered an issue related to detecting math context.

When utilizing the following Ultisnips code:

context "math()"
snippet "hat" "hat" riA
\hat{$1}$0
endsnippet

I received the following output:

Parse error: latex-snippets/tex.snippets: 104: 'context "math()"'

It seems that the detection of the math context is not functioning correctly. Any assistance in resolving this matter would be greatly appreciated.

According to ChatGPT, in YASnippet the line is described like # condition: (and (eq major-mode 'latex-mode) (texmathp))

Thank you for posting the issue and bringing this to my attention.

I have pushed a change to ignore context for now, as context is not yet supported by Ultyas. Please try the latest version of Ultyas and confirm that context is ignored. The latest version will at least allow you to generate Yasnippet snippets that contain contexts.

I plan to implement context support or a feature to add elisp code to Ultisnips snippets from Ultisnips comments and will let you know once it's available. Contributions are also welcome.