mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +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
|
||||
:require 'yasnippet)
|
||||
|
||||
(defadvice yas-global-mode (before yas--reload-with-jit (arg) activate)
|
||||
(cond ((and arg
|
||||
(numberp arg)
|
||||
(> arg 1))
|
||||
;; explicitly enabling
|
||||
(yas-reload-all))
|
||||
((not yas-global-mode)
|
||||
;; toggling
|
||||
(yas-reload-all))))
|
||||
(defun yas--global-mode-reload-with-jit-maybe ()
|
||||
(when yas-global-mode (yas-reload-all)))
|
||||
|
||||
(add-hook 'yas-global-mode-hook 'yas--global-mode-reload-with-jit-maybe)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Major mode stuff
|
||||
|
Loading…
x
Reference in New Issue
Block a user