mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
Revert "Closes #469: Don't use `yas--init-minor-keymap'"
This reverts commit 498cbe4138d74f39f7447acc9de456291c639724.
This commit is contained in:
parent
498cbe4138
commit
d809e886e0
33
yasnippet.el
33
yasnippet.el
@ -313,6 +313,9 @@ menu and the modes set in `yas--extra-modes' are listed.
|
|||||||
|
|
||||||
- If set to `full', every submenu is listed
|
- If set to `full', every submenu is listed
|
||||||
|
|
||||||
|
- It set to nil, don't display a menu at all (this requires a
|
||||||
|
`yas-reload-all' call if the menu is already visible).
|
||||||
|
|
||||||
Any other non-nil value, every submenu is listed."
|
Any other non-nil value, every submenu is listed."
|
||||||
:type '(choice (const :tag "Full" full)
|
:type '(choice (const :tag "Full" full)
|
||||||
(const :tag "Abbreviate" abbreviate)
|
(const :tag "Abbreviate" abbreviate)
|
||||||
@ -533,18 +536,12 @@ snippet itself contains a condition that returns the symbol
|
|||||||
(defvar yas--minor-mode-menu nil
|
(defvar yas--minor-mode-menu nil
|
||||||
"Holds the YASnippet menu.")
|
"Holds the YASnippet menu.")
|
||||||
|
|
||||||
(defvar yas-minor-mode-map
|
(defun yas--init-minor-keymap ()
|
||||||
|
"Set up the `yas-minor-mode' keymap."
|
||||||
(let ((map (make-sparse-keymap)))
|
(let ((map (make-sparse-keymap)))
|
||||||
(define-key map [(tab)] 'yas-expand)
|
(when yas-use-menu
|
||||||
(define-key map (kbd "TAB") 'yas-expand)
|
(easy-menu-define yas--minor-mode-menu
|
||||||
(define-key map "\C-c&\C-s" 'yas-insert-snippet)
|
map
|
||||||
(define-key map "\C-c&\C-n" 'yas-new-snippet)
|
|
||||||
(define-key map "\C-c&\C-v" 'yas-visit-snippet-file)
|
|
||||||
map)
|
|
||||||
"The keymap used when `yas-minor-mode' is active.")
|
|
||||||
|
|
||||||
(easy-menu-define yas--minor-mode-menu
|
|
||||||
yas-minor-mode-map
|
|
||||||
"Menu used when `yas-minor-mode' is active."
|
"Menu used when `yas-minor-mode' is active."
|
||||||
'("YASnippet"
|
'("YASnippet"
|
||||||
"----"
|
"----"
|
||||||
@ -646,7 +643,19 @@ snippet itself contains a condition that returns the symbol
|
|||||||
["Reload everything" yas-reload-all
|
["Reload everything" yas-reload-all
|
||||||
:help "Cleanup stuff, reload snippets, rebuild menus"]
|
:help "Cleanup stuff, reload snippets, rebuild menus"]
|
||||||
["About" yas-about
|
["About" yas-about
|
||||||
:help "Display some information about YASnippet"]))
|
:help "Display some information about YASnippet"])))
|
||||||
|
|
||||||
|
;; Now for the stuff that has direct keybindings
|
||||||
|
;;
|
||||||
|
(define-key map [(tab)] 'yas-expand)
|
||||||
|
(define-key map (kbd "TAB") 'yas-expand)
|
||||||
|
(define-key map "\C-c&\C-s" 'yas-insert-snippet)
|
||||||
|
(define-key map "\C-c&\C-n" 'yas-new-snippet)
|
||||||
|
(define-key map "\C-c&\C-v" 'yas-visit-snippet-file)
|
||||||
|
map))
|
||||||
|
|
||||||
|
(defvar yas-minor-mode-map (yas--init-minor-keymap)
|
||||||
|
"The keymap used when `yas-minor-mode' is active.")
|
||||||
|
|
||||||
(defvar yas--extra-modes nil
|
(defvar yas--extra-modes nil
|
||||||
"An internal list of modes for which to also lookup snippets.
|
"An internal list of modes for which to also lookup snippets.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user