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

Surrounding behavior with active region #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dcluna
Copy link

@dcluna dcluna commented Mar 21, 2018

This commit ensures that the expanded snippet follows the default behavior of yasnippet-insert-snippet, surrounding the active region.


This was motivated by the behavior of Spacemacs' SPC i s shortcut, which calls this package. I assume it should behave just like surrounding snippets, which is what this patch intends to fix.

This commit ensures that the expanded snippet follows the default behavior of
yasnippet-insert-snippet, surrounding the active region.
@@ -303,7 +303,11 @@ space match anyword greedy"
(candidate-transformer . (lambda (candidates)
(helm-yas-get-transformed-list helm-yas-cur-snippets-alist helm-yas-initial-input)))
(action . (("Insert snippet" . (lambda (template)
(yas-expand-snippet template helm-yas-point-start helm-yas-point-end)
(let ((start helm-yas-point-start)
(end helm-yas-point-end))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these variables are set by helm-yas-get-cmp-context, I wasn't sure if I should have changed that. Please let me know if that's the case.

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