Not able to get inword/word boundary insertion working

Asked by Matt

I have some snippets that insert simple erb (embedded Ruby) tags into HTML files. If I try to insert one of these tags immediately following another HTML tag, I'd like it to expand the snippet even without any whitespace.

My understanding is that a snippet like the following should expand no matter what's in front of it:

  snippet erb i
       <% ${1:code} %>

And that a snippet like the following should expand if there is a ">" in front of it, but not a word character:

  snippet erb w
       <% ${1:code} %>

But that's not happening. I'm running Ultisnips in the fairly common use case of YCM/Supertab; it seems relevant that these erb snippets ARE showing up as candidates for expansion, but then when one of them is selected and I tab to select it for expansion, I just go to the next candidate in the popup menu.

Question information

Language:
English Edit question
Status:
Answered
For:
UltiSnips Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
SirVer (sirver) said :
#1

That you can see the snippets in the completion is an indication that UltiSnips works okay. Maybe you have some trouble like here: https://github.com/SirVer/ultisnips/issues/512

Revision history for this message
Matt (mattmdavis) said :
#2

I took apart the whole YouCompleteMe/SuperTab/UltiSnips stack to test them
one at a time. It's definitely Ultisnips creating this behavior.

If I type "er" with preceding whitespace, and hit the key for
UltiSnipsListSnippets, I get four candidates listed in a window at the
bottom of my vim buffer.

If I type "er" with a preceding ">" character, from the HTML tag directly
ahead of it, and hit the key for UltiSnipsListSnippets, it appears to be
inserting a literal tab character, and the window at the bottom of the
buffer does not appear. Changing the keystroke that invokes
UltiSnipsListSnippets from <c-tab> (the default) to <c-l> made no
difference in this behavior.

On Fri, Jan 1, 2016 at 6:51 AM, SirVer <<email address hidden>
> wrote:

> Your question #280346 on UltiSnips changed:
> https://answers.launchpad.net/ultisnips/+question/280346
>
> Status: Open => Answered
>
> SirVer proposed the following answer:
> That you can see the snippets in the completion is an indication that
> UltiSnips works okay. Maybe you have some trouble like here:
> https://github.com/SirVer/ultisnips/issues/512
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ultisnips/+question/280346/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ultisnips/+question/280346
>
> You received this question notification because you asked the question.
>

Revision history for this message
SirVer (sirver) said :
#3

I suggest opening a detailed, reproducible bug report here: https://github.com/sirver/ultisnips. I am no longer maintaining UltiSnips, but seletsky is very good at tracking down bugs.

Can you help with this problem?

Provide an answer of your own, or ask Matt for more information if necessary.

To post a message you must log in.