mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
bugfix: use yas-global-mode-hook
instead of advising yas-global-mode
This commit is contained in:
parent
6e8b698e6e
commit
c566c929c0
13
yasnippet.el
13
yasnippet.el
@ -847,15 +847,10 @@ Do this unless `yas--dont-activate' is truish "
|
|||||||
:group 'yasnippet
|
:group 'yasnippet
|
||||||
:require 'yasnippet)
|
:require 'yasnippet)
|
||||||
|
|
||||||
(defadvice yas-global-mode (before yas--reload-with-jit (arg) activate)
|
(defun yas--global-mode-reload-with-jit-maybe ()
|
||||||
(cond ((and arg
|
(when yas-global-mode (yas-reload-all)))
|
||||||
(numberp arg)
|
|
||||||
(> arg 1))
|
(add-hook 'yas-global-mode-hook 'yas--global-mode-reload-with-jit-maybe)
|
||||||
;; explicitly enabling
|
|
||||||
(yas-reload-all))
|
|
||||||
((not yas-global-mode)
|
|
||||||
;; toggling
|
|
||||||
(yas-reload-all))))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Major mode stuff
|
;; Major mode stuff
|
||||||
|
Loading…
x
Reference in New Issue
Block a user