abo-abo / auto-yasnippet

quickly create disposable yasnippets
246 stars 15 forks source link

aya-create-one-line example not working #28

Closed vapniks closed 5 years ago

vapniks commented 5 years ago

When I try aya-create-one-line on the example: field$ = document.getElementById(""); nothing happens and a subsequent call to aya-expand just expands the snippet that was defined before that one. Also, is the example really correct? Shouldn't it be like this instead: field$ = document.getElementById("$");

I've tried both aya-create-one-line and aya-create on lines which contain $'s but no ~'s and cant get any of them to work. On lines with ~'s aya-create works as described. I've checked that the value of aya-marker-one-line is $

abo-abo commented 5 years ago

Works for me after the added commit. Please test.

vapniks commented 5 years ago

OK, it works now, but only if I put the cursor after all the placeholders. If I use aya-create on a line with ~'s it doesn't matter where the cursor is.

abo-abo commented 5 years ago

That's the expected behavior. To save one character, the point position is also used as the end position.

vapniks commented 5 years ago

OK