atom / snippets

Atom snippets package
MIT License
205 stars 100 forks source link

Wrong placeholder selection for two adjacent placeholders #210

Closed nerdgore closed 8 years ago

nerdgore commented 8 years ago

I tried creating a snippet that lets you remove parts selectively and got this IMO wrong behaviour.

Current Behaviour

Defining the snippet like this causes placeholder $2 to select the wrong character range if I edit placeholder $1. It does not matter if the length of the placeholder changes.

'New broken call':
    'prefix': 'callb'
    'body': '{call .${1:funcName}${2: data="${3:all}"}${4: /}}$0'

screen shot 2016-08-11 at 14 21 40

Expected Behaviour

If I add a space between $1 and $2 the selection works as expected.

'New call':
    'prefix': 'call'
    'body': '{call .${1:funcName} ${2:data="${3:all}"}${4: /}}$0'

screen shot 2016-08-11 at 14 22 19

To replicate the issue, you can check out my fork of the atom-soy package, which includes both snippets.

I am using atom 1.9.8, all packages are up to date.

lee-dohm commented 8 years ago

This is a duplicate of https://github.com/atom/text-document/issues/15. You may want to subscribe there for updates.