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

Multi-caret support #11

Closed
michaelfavia opened this issue Feb 27, 2014 · 16 comments
Closed

Multi-caret support #11

michaelfavia opened this issue Feb 27, 2014 · 16 comments

Comments

@michaelfavia
Copy link

I would like to support multicaret autocomplete in my snippets>

When you press tab to complete your snippet the first time it would simultaneously select all matching tab indexes in numerical order for insertion. Currently it just advances to the last one instead.

Example Snippet:

"Entity Metadata Wrapper": {
  "prefix": "emw",
  "body": "$${1:type}_wrapper = entity_metadata_wrapper('${1:type}', $${1:type});"
}

In this case pressing emw would add the completion body and multiselect all 3 $1 labeled replacement areas for editing. If there was a $2 (or multiple ones) it owuld select them after another tab press. im happy to get digging in the source for the package if you can point the right direction as this functionality is a huge timesaver for me and my dev team.

@fakewaffle
Copy link

+1

@jonathanwiesel
Copy link

+1

@mattma
Copy link

mattma commented Mar 6, 2014

same here. +1

@michaelfavia
Copy link
Author

@kevinsawicki If you can point me in the right direction in the snipped CS id be happy to take stab at this. id appreciate any high level knowledge as i can get in the weeds but i don't know the structure f the snippet parser or expander.

@kevinsawicki
Copy link
Contributor

Yeah, I'll need to think about this for a bit and try to see if it is something that can be supported with the current editor API.

Will ping back soon.

@tjpeden
Copy link

tjpeden commented Mar 10, 2014

@kevinsawicki, the editor already supports multiple cursors, shouldn't think it'd be that hard to do from there. Nonetheless, this is a crucial feature for me. TextMate and Sublime have spoiled me on this one and I'll find it hard to go back :-P

👍

@stmpy
Copy link

stmpy commented Mar 25, 2014

yes please!

@leecrossley
Copy link

+1

4 similar comments
@tijmenb
Copy link

tijmenb commented Mar 26, 2014

+1

@moltar
Copy link

moltar commented Mar 26, 2014

+1

@dbergey
Copy link

dbergey commented Apr 3, 2014

+1

@Grimeh
Copy link

Grimeh commented Apr 24, 2014

+1

@kevinsawicki
Copy link
Contributor

Refs #35

@kevinsawicki
Copy link
Contributor

This was fixed by @soren-n in #35 and will be included in the next Atom release, 0.93.0

@backspaces
Copy link

Whew! Does this mean that the current set of snippets should be re-written?

I.e. in the language-javascript/snippets/language-javascript.json file is:

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

.. if I change this to

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

.. will it modify the array name in both instances simultaneously?

@backspaces
Copy link

Just tried it, works like a charm!

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