mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
Respect y-b-l-cond from binding triggered snippets
The default value for `yas-buffer-local-condition' was only effective for `yas-expand-from-trigger-key' command, so it didn't have any effect when triggering snippets from a key binding (or if using the `yas-expand' alias). * yasnippet.el (yas-buffer-local-condition): Check if `this-command' is `yas-expand' or `yas-expand-from-keymap' too. Fixes #305, close #638
This commit is contained in:
parent
17fe7904ae
commit
140c415505
@ -462,10 +462,10 @@ Attention: These hooks are not run when exiting nested/stacked snippet expansion
|
|||||||
"Hooks to run just before expanding a snippet.")
|
"Hooks to run just before expanding a snippet.")
|
||||||
|
|
||||||
(defvar yas-buffer-local-condition
|
(defvar yas-buffer-local-condition
|
||||||
'(if (and (or (fourth (syntax-ppss))
|
'(if (and (let ((ppss (syntax-ppss)))
|
||||||
(fifth (syntax-ppss)))
|
(or (nth 3 ppss) (nth 4 ppss)))
|
||||||
this-command
|
(memq this-command '(yas-expand yas-expand-from-trigger-key
|
||||||
(eq this-command 'yas-expand-from-trigger-key))
|
yas-expand-from-keymap)))
|
||||||
'(require-snippet-condition . force-in-comment)
|
'(require-snippet-condition . force-in-comment)
|
||||||
t)
|
t)
|
||||||
"Snippet expanding condition.
|
"Snippet expanding condition.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user