Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Backslash in snippet not inserted #127

Closed
jaenthemaen opened this issue Apr 13, 2015 · 6 comments
Closed

Backslash in snippet not inserted #127

jaenthemaen opened this issue Apr 13, 2015 · 6 comments

Comments

@jaenthemaen
Copy link

I'm using a number of latex snippets that have stopped working with the latest update of the editor (running the latest OSX version). The backslash in these snippets is no longer inserted, meaning this:

'.text.latex':
    '\\emph{}':
        'prefix': 'em'
        'body': '\\emph{$1} $2'

leads to this:

emph{}

instead of:

\emph{}

It also doesn't seem to matter where the double backslash is placed in the snippet. It is ignored whenever another letter is following the double backslash.

@winstliu
Copy link
Contributor

Looks like this broke with #123. Perhaps try one or three backslashes?

@jaenthemaen
Copy link
Author

Just did and neither of which is working for me, unfortunately.

@thomasjo
Copy link

I can confirm that this is broken. Unsure whether this can be reasonably fixed at the snippet level.

@thomasjo
Copy link

OK, so double-escaping seems to work. Using @jaenthemaen example, this works as expected

'.text.tex.latex':
  '\\emph{}':
    'prefix': 'em'
    'body': '\\\\emph{$1} $2'

NB: I changed the grammar scope since this is the scope that language-latex uses.

@izuzak
Copy link
Contributor

izuzak commented Apr 13, 2015

Using 4 backslashes does it for me. Try:

'.text.latex':
    '\\emph{}':
        'prefix': 'em'
        'body': '\\\\emph{$1} $2'

@jaenthemaen
Copy link
Author

Indeed, that does the trick! 👍 Thank you!

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

4 participants