mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
Allow customizing overlay priority
* yasnippet.el (yas-overlay-priority): New custom option. (yas--make-control-overlay, yas--make-move-active-field-overlay): Use it.
This commit is contained in:
parent
e8ed276e2c
commit
65952e3054
10
yasnippet.el
10
yasnippet.el
@ -526,6 +526,12 @@ conditions.
|
|||||||
(const :tag "Disable all snippet expansion" nil)
|
(const :tag "Disable all snippet expansion" nil)
|
||||||
sexp))
|
sexp))
|
||||||
|
|
||||||
|
(defcustom yas-overlay-priority 100
|
||||||
|
"Priority to use for yasnippets overlays.
|
||||||
|
This is useful to control whether snippet navigation bindings
|
||||||
|
override bindings from other packages (e.g., `company-mode')."
|
||||||
|
:type 'integer)
|
||||||
|
|
||||||
|
|
||||||
;;; Internal variables
|
;;; Internal variables
|
||||||
|
|
||||||
@ -3500,7 +3506,7 @@ holds the keymap."
|
|||||||
nil
|
nil
|
||||||
t)))
|
t)))
|
||||||
(overlay-put overlay 'keymap yas-keymap)
|
(overlay-put overlay 'keymap yas-keymap)
|
||||||
(overlay-put overlay 'priority 100)
|
(overlay-put overlay 'priority yas-overlay-priority)
|
||||||
(overlay-put overlay 'yas--snippet snippet)
|
(overlay-put overlay 'yas--snippet snippet)
|
||||||
overlay))
|
overlay))
|
||||||
|
|
||||||
@ -3556,7 +3562,7 @@ Move the overlay, or create it if it does not exit."
|
|||||||
(make-overlay (yas--field-start field)
|
(make-overlay (yas--field-start field)
|
||||||
(yas--field-end field)
|
(yas--field-end field)
|
||||||
nil nil t))
|
nil nil t))
|
||||||
(overlay-put yas--active-field-overlay 'priority 100)
|
(overlay-put yas--active-field-overlay 'priority yas-overlay-priority)
|
||||||
(overlay-put yas--active-field-overlay 'face 'yas-field-highlight-face)
|
(overlay-put yas--active-field-overlay 'face 'yas-field-highlight-face)
|
||||||
(overlay-put yas--active-field-overlay 'yas--snippet snippet)
|
(overlay-put yas--active-field-overlay 'yas--snippet snippet)
|
||||||
(overlay-put yas--active-field-overlay 'modification-hooks '(yas--on-field-overlay-modification))
|
(overlay-put yas--active-field-overlay 'modification-hooks '(yas--on-field-overlay-modification))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user