Snippet syntax doesn't accept " as a trigger

Bug #1155996 reported by DavidBriscoe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UltiSnips
Fix Committed
Undecided
Unassigned

Bug Description

I have a python snippet for multi-line strings:

snippet " "triple-quoted string"
"""
${1:doc}
"""
endsnippet

The syntax colours " " as a string (snipString) and triple-quoted string" (including that trailing quote) as the trigger (snipStart). The snippet works as expected.

I'm using e4274950abd73acbd48f5acf381f0460f17c6dc9.

I don't know vim syntax files very well, but I think you could create a new syntax group for docstrings that must be at end-of-line. I've attached a patch that does that. It works in my use case and appears to be correct elsewhere. snipString is also used in global, but I don't understand why (and whether that should be a snipDocString too).

Revision history for this message
DavidBriscoe (idbrii) wrote :
Revision history for this message
SirVer (sirver) wrote :

Thanks for the patch. I applied it and pushed again.

I have no idea if the syntax file could be improved - it was a contribution and i only changed very minor things in it as I have little knowledge about syntax files.

Changed in ultisnips:
status: New → Fix Committed
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.