atom / snippets

Atom snippets package
MIT License
204 stars 102 forks source link

Tab stops with selections don't select correct text when curly braces `{}` are present within the desired selection #162

Closed stephantabor closed 9 years ago

stephantabor commented 9 years ago

creating tab stops with selections when there are curly braces in the tab stop selection area doesn't work as desired.

Example:

{
  ".source.js": {
    "test": {
      "prefix": "ayy",
      "body": "${1:{ lmao: 0 }}"
    }
  }
}
screenshot 2015-07-18 20 16 59 screenshot 2015-07-18 20 17 07

I tried with JSON and CSON. Also tried escaping various braces in CSON.

stephantabor commented 9 years ago

ooh nevermind i figured it out

'.source.js':
  'test':
    'prefix': 'ayy'
    'body': '${1:{ lmao: 0 \\}}'
audreytoskin commented 9 years ago

It'd be great if there was something about this in the README. I dunno, maybe this is because I don't write a lot of CoffeeScript, but I wouldn't have ever guessed that you need to escape the backslash instead of escaping the curly bracket itself.

audreytoskin commented 9 years ago

Just sent a pull request. Figured it'd be easier to write it myself, but you can reject it and write your own explanation, if you prefer.