occivink / kakoune-snippets

Snippet support for kakoune
The Unlicense
49 stars 6 forks source link

Thrigger with same ending as another trigger will call wrong snippet #12

Closed andreyorst closed 5 years ago

andreyorst commented 5 years ago

defining this two snippets, will result in availability of only one of them:

set-option -add window snippets 'if {}' 'if' %{
    snippets-insert 'if ($1) {
                     ${indent}$0
                     }'
}

set-option -add window snippets 'if {} else {}' 'elif' %{
    snippets-insert 'if ($1) {
                     ${indent}$2
                     } else {
                     ${indent}$0
                     }'
}

If I type elif and hit my expand key, if snippet will be expanded instead of elif.

occivink commented 5 years ago

Good catch