mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
* yasnippet.el (yas--keybinding-beyond-yasnippet): Add docstring. (yas--fallback): Also let-bind `yas-minor-mode' to nil when falling back.
This commit is contained in:
parent
6877bc6db3
commit
70151f4f1e
11
yasnippet.el
11
yasnippet.el
@ -2254,6 +2254,12 @@ Common gateway for `yas-expand-from-trigger-key' and
|
||||
"outside of the `yas-minor-mode-map'.")))
|
||||
((eq yas-fallback-behavior 'call-other-command)
|
||||
(let* ((yas-fallback-behavior 'yas--fallback)
|
||||
;; Also bind `yas-minor-mode' to prevent fallback
|
||||
;; loops when other extensions use mechanisms similar
|
||||
;; to `yas--keybinding-beyond-yasnippet'. (github #525
|
||||
;; and #526)
|
||||
;;
|
||||
(yas-minor-mode nil)
|
||||
(beyond-yasnippet (yas--keybinding-beyond-yasnippet)))
|
||||
(yas--message 4 "Falling back to %s" beyond-yasnippet)
|
||||
(assert (or (null beyond-yasnippet) (commandp beyond-yasnippet)))
|
||||
@ -2263,7 +2269,8 @@ Common gateway for `yas-expand-from-trigger-key' and
|
||||
((and (listp yas-fallback-behavior)
|
||||
(cdr yas-fallback-behavior)
|
||||
(eq 'apply (car yas-fallback-behavior)))
|
||||
(let ((yas-fallback-behavior 'yas--fallback))
|
||||
(let ((yas-fallback-behavior 'yas--fallback)
|
||||
(yas-minor-mode nil))
|
||||
(if (cddr yas-fallback-behavior)
|
||||
(apply (cadr yas-fallback-behavior)
|
||||
(cddr yas-fallback-behavior))
|
||||
@ -2275,7 +2282,7 @@ Common gateway for `yas-expand-from-trigger-key' and
|
||||
nil)))
|
||||
|
||||
(defun yas--keybinding-beyond-yasnippet ()
|
||||
"Return the ??"
|
||||
"Get current keys's binding as if YASsnippet didn't exist."
|
||||
(let* ((yas-minor-mode nil)
|
||||
(yas--direct-keymaps nil)
|
||||
(keys (this-single-command-keys)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user