atom / snippets

Atom snippets package
MIT License
205 stars 100 forks source link

Code selections cannot end with '\' #225

Closed llamicron closed 7 years ago

llamicron commented 7 years ago

Working in the '.php' scope. Have not tested in other scopes.

Here i have a snippet:

'Factory User':
  'prefix': 'fac_user'
  'body': '$user = factory(${1:App\\}User)->create($2);'

When expanding this snippet, i get:

$user = factory(${1:App}User)->create();

If i put a single '\' in the snippet like so:

'Factory User':
  'prefix': 'fac_user'
  'body': '$user = factory(${1:App\}User)->create($2);'

i get:

$user = factory(AppUser)->create();

with 'App' being highlighted.

I think in the first situation, 'App\' should be highlighted, but instead the syntax for the code selection is literally put in the snippet.

50Wliu commented 7 years ago

If you want an actual backslash you would need to quadruple-escape it: \\\\.