g:UltiSnipsExpandTrigger doesn't work as expected

Bug #1260941 reported by Julian Martin Grinblat
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UltiSnips
Invalid
Undecided
Unassigned

Bug Description

When editing html files, snippets work wonderfully as long as there's a whitespace before the snippet keyword. That means that, for example, if I were to try and insert a snippet directly after an html tag, it won't work. For example:

<div>input|

Triggering g:UltiSnipsExpandTrigger (with <C-j> in my case) will not trigger the input snippet, whereas:

<div> input|

Hitting <C-j> in that case works perfectly. I would expect both of them to work.

The output of :py import sys; print sys.version:
2.7.5 (default, May 29 2013, 02:28:51)
[GCC 4.8.0]

Thanks!

Revision history for this message
SirVer (sirver) wrote :

you need to use the inword (i) or word boundary (w) options - see the docs https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt#L605

Changed in ultisnips:
status: New → Invalid
Revision history for this message
Julian Martin Grinblat (juliangrinblat) wrote :

Thank you very much for your response!
I was wondering, then, if it wouldn't make more sense to make the snippets from the file html.snippets use the "w" option, since it is rather common to trigger them after a closing tag. I attached a patch with the changes I made to those snippets. I added the w option to those snippets that are most likely to be triggered after a tag. For your consideration.
Julian.

Revision history for this message
SirVer (sirver) wrote :

Thanks. I applied the patch without change.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.