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

Add multi-caret support to all snippets #31

Closed
backspaces opened this issue Jun 13, 2014 · 2 comments
Closed

Add multi-caret support to all snippets #31

backspaces opened this issue Jun 13, 2014 · 2 comments
Assignees

Comments

@backspaces
Copy link

The final result of atom/snippets#11 allows a snippet to have duplicate names, very useful for most snippets that use the same name in multiple places.

For example:

"for": {
  "prefix": "for",
  "body": "for (var i = 0; i < ${1:array}.length; i++) {\n\t${2:array}[i]\n}"
},

can now be converted to:

"for": {
  "prefix": "for",
  "body": "for (var i = 0; i < ${1:array}.length; i++) {\n\t${1:array}[i]\n}"
},

I tried this by adding

{
  ".source.js": {
    "xxx": {
      "prefix": "xxx",
      "body": "for (var i = 0; i < ${1:array}.length; i++) {\n\t${1:array}[i]\n}"
    },
  },
}

to my snippets and it works just fine and looks sexy!

@kevinsawicki
Copy link
Contributor

Do you have time to put together a pull request for this? It sounds good to me.

@50Wliu 50Wliu self-assigned this Jul 25, 2015
@50Wliu
Copy link
Contributor

50Wliu commented Jul 25, 2015

This should already be implemented - I just checked through all the snippets and the applicable ones have multi-caret support.

@50Wliu 50Wliu closed this as completed Jul 25, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants