Skip to content

Backslash in snippet #114

@Champitoad

Description

@Champitoad

Hi,

I am trying to create a custom snippet for LaTeX macros that looks like this:

"LaTeX macro": {
    "label": "LaTeX macro",
    "description": "Surround with a LaTeX macro",
    "snippet": "\\$1{$TM_SELECTED_TEXT}$0",
    "languageIds": [
        "latex"
    ]
},

But if I apply it to the selection foobar it generates $1{foobar}, instead of \{foobar} with the cursor located next to the backslash. If I remove the escaped backslash \\ in the snippet I get correct behavior for the cursor.

I infer that there is some issue handling either backslashes or escaped characters?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions