mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
add dropdown-list.el support.
This commit is contained in:
parent
8337700325
commit
6cd5dbddf1
14
yasnippet.el
14
yasnippet.el
@ -721,6 +721,20 @@ t is returned simply."
|
|||||||
(defun yas/text-popup-for-template (templates)
|
(defun yas/text-popup-for-template (templates)
|
||||||
"Can't display popup menu in text mode. Just select the first one."
|
"Can't display popup menu in text mode. Just select the first one."
|
||||||
(yas/template-content (cdar templates)))
|
(yas/template-content (cdar templates)))
|
||||||
|
(defun yas/dropdown-list-popup-for-template (templates)
|
||||||
|
"Use dropdown-list.el to popup for templates. Better than the
|
||||||
|
default \"select first\" behavior of `yas/text-popup-for-template'.
|
||||||
|
You can also use this in window-system.
|
||||||
|
|
||||||
|
NOTE: You need to download and install dropdown-list.el to use this."
|
||||||
|
(if (fboundp 'dropdown-list)
|
||||||
|
(yas/template-content
|
||||||
|
(cdr (nth (dropdown-list (mapcar (lambda (i)
|
||||||
|
(yas/template-name
|
||||||
|
(cdr i)))
|
||||||
|
templates))
|
||||||
|
templates)))
|
||||||
|
(error "Please download and install dropdown-list.el to use this")))
|
||||||
|
|
||||||
(defun yas/popup-for-template (templates)
|
(defun yas/popup-for-template (templates)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user