mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
YASnippet now integrate with hippie-expand
This commit is contained in:
parent
bca01e5638
commit
88bc80164f
15
yasnippet.el
15
yasnippet.el
@ -907,7 +907,6 @@ NOTE: You need to download and install dropdown-list.el to use this."
|
|||||||
(error "Please download and install dropdown-list.el to use this")))
|
(error "Please download and install dropdown-list.el to use this")))
|
||||||
|
|
||||||
(defun yas/popup-for-template (templates)
|
(defun yas/popup-for-template (templates)
|
||||||
|
|
||||||
(if window-system
|
(if window-system
|
||||||
(funcall yas/window-system-popup-function templates)
|
(funcall yas/window-system-popup-function templates)
|
||||||
(funcall yas/text-popup-function templates)))
|
(funcall yas/text-popup-function templates)))
|
||||||
@ -1122,6 +1121,20 @@ when the condition evaluated to non-nil."
|
|||||||
(list (list key template name condition))))
|
(list (list key template name condition))))
|
||||||
|
|
||||||
|
|
||||||
|
(defun yas/hippie-try-expand (first-time?)
|
||||||
|
"Integrate with hippie expand. Just put this function in
|
||||||
|
`hippie-expand-try-functions-list'."
|
||||||
|
(if (not first-time?)
|
||||||
|
(let ((yas/fall-back-behavior 'return-nil))
|
||||||
|
(yas/expand))
|
||||||
|
(when (and (null (car buffer-undo-list))
|
||||||
|
(eq 'apply
|
||||||
|
(car (cadr buffer-undo-list)))
|
||||||
|
(eq 'yas/undo-expand-snippet
|
||||||
|
(cadr (cadr buffer-undo-list))))
|
||||||
|
(undo 1))
|
||||||
|
nil))
|
||||||
|
|
||||||
(defun yas/expand ()
|
(defun yas/expand ()
|
||||||
"Expand a snippet."
|
"Expand a snippet."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user