Closed pitkling closed 2 months ago
I think you are correct. I tested your suggestion and it seems to work as expected, at least with luasnip. I think that the escaping fixes the issue with native snippets. I created a PR #473
That PR has been merged, perhaps @pitkling can confirm as well?
Great, thanks @DimitrisDimitropoulos! The updated snippets work fine with the native snippet expansion :).
I spotted a few more that need a similar update: Pretty much every snippet in vscode-latex-snippets.json
that has a line containing addlegendentry
does not properly escape the math inside the addlegendentry
macro. The only such snippet that does the escaping correctly at the moment is plotgraph3d
. Other than that, I think the remaining math-related snippets in that file are ok.
Just approved and merged #476. If @pitkling can confirm, then I think this issue can be (finally) closed :partying_face:
Everything seems fine now, thanks! :)
The vscode LaTeX snippets that involve math (or at least some of them) do not properly escape the math delimiter
$
. See for example the Inline Math snippet. It's body is$ $1 $$0
, but from the vscode grammar definition I would have expected the body should be\\$ $1 \\$$0
(double escape necessary because of the JSON file format).Is this intended? It seems some snippet engines can cope without the escaping (e.g., LuaSnip plugin for Neovim), while others (like the integrated snippet expansion in Neovim 10+ via
vim.snippet.expand
) choke on the unescaped snippets.