* replaced <tab> by TAB and fixed a small bug in $> indendation

This commit is contained in:
capitaomorte 2009-07-15 07:23:13 +00:00
parent a1a4bfc773
commit 63378d00b2

View File

@ -93,7 +93,7 @@ representation using `read-kbd-macro'. "
:type 'string :type 'string
:group 'yasnippet) :group 'yasnippet)
(defcustom yas/next-field-key "<tab>" (defcustom yas/next-field-key "TAB"
"The key to navigate to next field when a snippet is active. "The key to navigate to next field when a snippet is active.
Value is a string that is converted to the internal Emacs key Value is a string that is converted to the internal Emacs key
@ -1705,7 +1705,8 @@ Meant to be called in a narrowed buffer, does various passes"
(yas/indent snippet))) (yas/indent snippet)))
(defun yas/indent (snippet) (defun yas/indent (snippet)
;;; XXX: fixed indentation not working ;;; XXX: fixed indentation not working
(save-excursion
(cond ((eq yas/indent-line 'fixed) (cond ((eq yas/indent-line 'fixed)
(let ((fill-prefix (make-string yas/start-column ? ))) (let ((fill-prefix (make-string yas/start-column ? )))
(indent-region (point-min) (point-max)))) (indent-region (point-min) (point-max))))
@ -1733,11 +1734,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)))
(save-excursion
(while (re-search-forward "$>" nil t) (while (re-search-forward "$>" nil t)
(delete-region (match-beginning 0) (match-end 0)) (delete-region (match-beginning 0) (match-end 0))
(when (not (eq yas/indent-line 'auto)) (when (not (eq yas/indent-line 'auto))
(indent-according-to-mode)))) (indent-according-to-mode)))))
(defun yas/escape-string (escaped) (defun yas/escape-string (escaped)