Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: mutiple key support #1068

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ShuguangSun
Copy link

@ShuguangSun ShuguangSun commented Sep 2, 2020

Add support for multiple key for one snippet. For example, the snippet below will be parsed as two snippets with two keys.

# name: choose
# key: choose
# key: choosevalue
# --
\\\"\${${1:1}:$$(yas-choose-value '("$0"))}\\\"

To avoid introducing bugs, I make a copy of some functions, for example, yas--parse-template to yas--parse-template-for-mulkey, and make changes to those functions.
M-x yas-compile-directory-for-mulkey for JIT.

As this patch intends to modifide the funtion yas--parse-template which is a quite core function, I'm not sure whether this patch can be accepted. If it is not acceptable now, I'd like to ask your kindness agreement for me to make a separate package, like the one in
yasnippet-multiple-key. It uses your code and the patch.

@ShuguangSun
Copy link
Author

Related with:
#375
#114
#342

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant