mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
* "$>" now working
* `yas/hippie-try-expand' fixed to work with new undo system
This commit is contained in:
parent
4429104dfc
commit
a1a4bfc773
22
yasnippet.el
22
yasnippet.el
@ -66,11 +66,13 @@ other values interactively."
|
|||||||
|
|
||||||
The following values are possible:
|
The following values are possible:
|
||||||
|
|
||||||
`nothing' Don't apply any indendation after expansion;
|
|
||||||
|
|
||||||
`fixed' Indent the snippet to the current column;
|
`fixed' Indent the snippet to the current column;
|
||||||
|
|
||||||
`auto' Indent each line of the snippet with `indent-according-to-mode'"
|
`auto' Indent each line of the snippet with `indent-according-to-mode'
|
||||||
|
|
||||||
|
Every other value means don't apply any snippet-side indendation
|
||||||
|
after expansion (the manual per-line \"$>\" indentation still
|
||||||
|
applies)."
|
||||||
:type '(choice (const :tag "Nothing" nothing)
|
:type '(choice (const :tag "Nothing" nothing)
|
||||||
(const :tag "Fixed" fixed)
|
(const :tag "Fixed" fixed)
|
||||||
(const :tag "Auto" auto))
|
(const :tag "Auto" auto))
|
||||||
@ -913,12 +915,7 @@ when the condition evaluated to non-nil."
|
|||||||
(if (not first-time?)
|
(if (not first-time?)
|
||||||
(let ((yas/fallback-behavior 'return-nil))
|
(let ((yas/fallback-behavior 'return-nil))
|
||||||
(yas/expand))
|
(yas/expand))
|
||||||
(when (and (null (car buffer-undo-list))
|
(undo 1)
|
||||||
(eq 'apply
|
|
||||||
(car (cadr buffer-undo-list)))
|
|
||||||
(eq 'yas/undo-expand-snippet
|
|
||||||
(cadr (cadr buffer-undo-list))))
|
|
||||||
(undo 1))
|
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
(defun yas/require-template-condition ()
|
(defun yas/require-template-condition ()
|
||||||
@ -1736,7 +1733,12 @@ Meant to be called in a narrowed buffer, does various passes"
|
|||||||
;;
|
;;
|
||||||
(set-marker (yas/snippet-exit snippet) (point))))))
|
(set-marker (yas/snippet-exit snippet) (point))))))
|
||||||
(t
|
(t
|
||||||
nil)))
|
nil))
|
||||||
|
(while (re-search-forward "$>" nil t)
|
||||||
|
(delete-region (match-beginning 0) (match-end 0))
|
||||||
|
(when (not (eq yas/indent-line 'auto))
|
||||||
|
(indent-according-to-mode))))
|
||||||
|
|
||||||
|
|
||||||
(defun yas/escape-string (escaped)
|
(defun yas/escape-string (escaped)
|
||||||
(concat "YASESCAPE" (format "%d" escaped) "PROTECTGUARD"))
|
(concat "YASESCAPE" (format "%d" escaped) "PROTECTGUARD"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user