fix the bug on expanding a snippet without

This commit is contained in:
Zhang Chiyuan 2008-10-20 21:07:18 +00:00
parent 331812fefb
commit d93bea8204

View File

@ -803,10 +803,12 @@ will be deleted before inserting template."
;; Step 16: Do necessary indenting ;; Step 16: Do necessary indenting
(save-excursion (save-excursion
(goto-char (overlay-start (yas/snippet-overlay snippet))) (let ((ovst (overlay-start (yas/snippet-overlay snippet))))
(while (re-search-forward "$>" nil t) (when ovst
(replace-match "") (goto-char ovst)
(indent-according-to-mode))))))) (while (re-search-forward "$>" nil t)
(replace-match "")
(indent-according-to-mode)))))))))
(defun yas/current-snippet-overlay (&optional point) (defun yas/current-snippet-overlay (&optional point)
"Get the most proper overlay which is belongs to a snippet." "Get the most proper overlay which is belongs to a snippet."