How to hide/overriding other snippet with same name defined for parent mode?

260 views
Skip to first unread message

shjk

unread,
Jul 25, 2012, 10:26:48 AM7/25/12
to smart-...@googlegroups.com
Hi,

I've got a hl snippet to produce a horizontal line up to the fill column which is defined for text-mode. For some modes that have text-mode as parent (via .yas-parent) I want to replace this with a different snippet. In 0.5.* this was possible by just adding a snippet with the same name in the more specific mode. In 0.7.0 I get asked which of the two snippets I want to expand (without making it possible to see which is which). Is it possible to tell yasnippet to always use the more specific one in 0.7.0/0.8.0? I can create a work-around by having a more complex snippet that expands to different things depending on the major-mode but this is a bit inconvenient and a hacky non-solution.

shjk

João Távora

unread,
Jul 25, 2012, 12:45:02 PM7/25/12
to smart-...@googlegroups.com
I see, I was never aware of this "feature" in 0.5 (which I doubt was
planned). I will have to think about this... Maybe you can open an
issue on github.
> --
> You received this message because you are subscribed to the Google Groups
> "smart-snippet and YASnippet" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/smart-snippet/-/OmvOFVVBLKAJ.
> To post to this group, send email to smart-...@googlegroups.com.
> To unsubscribe from this group, send email to
> smart-snippe...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/smart-snippet?hl=en.



--
João Távora

shjk

unread,
Jul 26, 2012, 5:54:40 AM7/26/12
to smart-...@googlegroups.com

Maybe just providing a way to put elisp helper code into snippet libraries solves this in a nicer way?

João Távora

unread,
Jul 26, 2012, 6:42:11 PM7/26/12
to smart-...@googlegroups.com
I don't know how that would help, but there is already such a way, use
".yas-setup.el"!

Another item to add to the 0.8 changelog, btw...

João
> --
> You received this message because you are subscribed to the Google Groups
> "smart-snippet and YASnippet" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/smart-snippet/-/hJBsih0C_6cJ.
Reply all
Reply to author
Forward
0 new messages