occivink / kakoune-snippets

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

Snippet always expand to the first entry #46

Closed CharlesGueunet closed 2 years ago

CharlesGueunet commented 2 years ago

Using kakoune master, the expand of a snippet always trigger my first snippet.

more details

I have the following configuration for kakoune snippet:

  set-option -add global snippets_directories "%opt{plug_install_dir}/kakoune-snippet-collection/snippets"
  set-option global snippets_auto_expand true

  map global insert '<c-s>' '<a-;>: snippets-expand-trigger<ret><esc>'
  map global insert '<c-n>' '<a-;>: snippets-select-next-placeholders<ret><esc>'
  map global normal '<c-n>' ': snippets-select-next-placeholders<ret>'

I work only on CPP. Whenever a snippet is triggered, the result is:

#include <iostream>

even if I typed for, main, ...

I also tried to call the snippet-expand-selection manually with the same result.

Best, Charles

occivink commented 2 years ago

Hi, that's probably due to one of the recent breaking changes. Most likely it's the <space> <-> , swap. I don't have time to work on it this week, but chances are you can just these two keys (in the context of an exec) and it will work.