atom / snippets

Atom snippets package
MIT License
205 stars 100 forks source link

arrow keys should break the multi-caret snippet #185

Open matteoacrossi opened 8 years ago

matteoacrossi commented 8 years ago

Consider a snippet with multiple caret. For instance, the \begin{} ... \end{} snippet

  '\\\\begin{}…\\\\end{}':
    'prefix': 'begin'
    'body': '\\\\begin{${1:env}}\n\t$2\n\\\\end{${1:env}}'

in language-latex. When I'm editing the placeholder, everything is mirrored by the second caret.

But this is true also for the arrow keys: both carets move in every direction and this gives rise to inconsistent behavior (for instance, both cursors can move to a new line and add characters there).

The expected behavior would be that the placeholder editing ends when an arrow key is pressed. This happens, for instance, in TextMate with the very same snippet.

Using Atom version 1.2.3

FlorianWendelborn commented 7 years ago

@teored90 The multi-cursor editing is a core feature of atom. Removing it for snippets would be very inconsistent and confusing. I bet that a lot of people rely on this behavior.

I suggest closing this in favor of using esc.