summaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/yasnippet.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/lisp/yasnippet.el')
-rw-r--r--.emacs.d/lisp/yasnippet.el31
1 files changed, 17 insertions, 14 deletions
diff --git a/.emacs.d/lisp/yasnippet.el b/.emacs.d/lisp/yasnippet.el
index 5f17465..b36c422 100644
--- a/.emacs.d/lisp/yasnippet.el
+++ b/.emacs.d/lisp/yasnippet.el
@@ -4302,23 +4302,26 @@ The SNIPPET's markers are preserved."
4302 (setq yas--indent-markers nil)) 4302 (setq yas--indent-markers nil))
4303 ;; Now do stuff for `fixed' and `auto'. 4303 ;; Now do stuff for `fixed' and `auto'.
4304 (save-excursion 4304 (save-excursion
4305 ;; We need to be at end of line, so that `forward-line' will only
4306 ;; report 0 if it actually moves over a newline.
4307 (end-of-line)
4305 (cond ((eq yas-indent-line 'fixed) 4308 (cond ((eq yas-indent-line 'fixed)
4306 (forward-line 1) 4309 (when (= (forward-line 1) 0)
4307 (let ((indent-line-function 4310 (let ((indent-line-function
4308 (lambda () 4311 (lambda ()
4309 ;; We need to be at beginning of line in order to 4312 ;; We need to be at beginning of line in order to
4310 ;; indent existing whitespace correctly. 4313 ;; indent existing whitespace correctly.
4311 (beginning-of-line) 4314 (beginning-of-line)
4312 (indent-to-column yas--indent-original-column)))) 4315 (indent-to-column yas--indent-original-column))))
4316 (yas--indent-region (line-beginning-position)
4317 (point-max)
4318 snippet))))
4319 ((eq yas-indent-line 'auto)
4320 (when (or yas-also-auto-indent-first-line
4321 (= (forward-line 1) 0))
4313 (yas--indent-region (line-beginning-position) 4322 (yas--indent-region (line-beginning-position)
4314 (point-max) 4323 (point-max)
4315 snippet))) 4324 snippet))))))
4316 ((eq yas-indent-line 'auto)
4317 (unless yas-also-auto-indent-first-line
4318 (forward-line 1))
4319 (yas--indent-region (line-beginning-position)
4320 (point-max)
4321 snippet)))))
4322 4325
4323(defun yas--collect-snippet-markers (snippet) 4326(defun yas--collect-snippet-markers (snippet)
4324 "Make a list of all the markers used by SNIPPET." 4327 "Make a list of all the markers used by SNIPPET."