mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
Fix: YAS-RELOAD-ALL preserves user bindings on YAS-MINOR-MODE-MAP cleanup
- Don't create a new keymap on every reload
This commit is contained in:
parent
9b31880ed1
commit
1ef0091de1
16
yasnippet.el
16
yasnippet.el
@ -1862,21 +1862,25 @@ loading."
|
||||
;; `yas--editing-template' to nil, make it guess it next time around
|
||||
(mapc #'(lambda (buffer) (setq yas--editing-template nil)) (buffer-list))))
|
||||
|
||||
;; Empty all snippet tables, parenting info and all menu tables
|
||||
;; Empty all snippet tables and parenting info
|
||||
;;
|
||||
(setq yas--tables (make-hash-table))
|
||||
(setq yas--parents (make-hash-table))
|
||||
|
||||
;; Before killing `yas--menu-table' use its keys to cleanup the
|
||||
;; mode menu parts of `yas--minor-mode-menu' (thus also cleaning
|
||||
;; up `yas-minor-mode-map', which points to it)
|
||||
;;
|
||||
(maphash #'(lambda (menu-symbol keymap)
|
||||
(define-key yas--minor-mode-menu (vector menu-symbol) nil))
|
||||
yas--menu-table)
|
||||
;; Now empty `yas--menu-table' as well
|
||||
(setq yas--menu-table (make-hash-table))
|
||||
|
||||
;; Cancel all pending 'yas--scheduled-jit-loads'
|
||||
;;
|
||||
(setq yas--scheduled-jit-loads (make-hash-table))
|
||||
|
||||
;; Init the `yas-minor-mode-map', taking care not to break the
|
||||
;; menu....
|
||||
;;
|
||||
(setcdr yas-minor-mode-map (cdr (yas--init-minor-keymap)))
|
||||
|
||||
;; Reload the directories listed in `yas-snippet-dirs' or prompt
|
||||
;; the user to select one.
|
||||
;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user