occivink / kakoune-snippets

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

snippets_auto_expand appears to do nothing #44

Closed SaphiraKai closed 3 years ago

SaphiraKai commented 3 years ago

Weirdly enough, when I first got this plugin it would automatically expand snippets by default despite saying that wasn't the default behavior.

More annoyingly though, is that it has suddenly stopped doing that for some reason I can't figure out. And I can't seem to get that behavior back:

set global snippets_auto_expand true

That line doesn't do anything, I've tried it with different snippets in different languages but it doesn't auto-expand. I've also confirmed that using the :snippets-expand-trigger and such commands manually does work, but that's hardly an efficient solution.

Is this a bug, or (more likely) am I just doing something wrong? I'm very new to kakoune, so I wouldn't be surprised if my syntax is incorrect. Thanks in advance for any help!

occivink commented 3 years ago

You're right that the documentation is incorrect, the flag is set to true by default. The most likely reason that it would not expand anything is because your snippets are not being loaded properly. Can you run snippets-info? This should tell you which snippets are available in the current context.

SaphiraKai commented 3 years ago

After doing a bit of trial and error I managed to get manual expansion to work using: map global insert <a-a> '<esc>b: snippets-expand-trigger<ret>' And I got snippets-select-next-placeholder working with: map global normal <a-a> ': snippets-select-next-placeholders<ret>'

My snippets ARE being correctly loaded, :snippets-info returns all of the snippets I have for the current filetype.

SaphiraKai commented 3 years ago

Huh... uhm, I don't know what happened, but JUST now auto-expansion started working again

Odd.

Well my problem is solved, so i'm going to close the issue, but there is definitely something weird going on that still isn't understood