From d93bea8204eaef02dd5a87415255af12b0d5b02d Mon Sep 17 00:00:00 2001 From: Zhang Chiyuan Date: Mon, 20 Oct 2008 21:07:18 +0000 Subject: [PATCH] fix the bug on expanding a snippet without --- yasnippet.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/yasnippet.el b/yasnippet.el index 82f95d9..9e27984 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -803,10 +803,12 @@ will be deleted before inserting template." ;; Step 16: Do necessary indenting (save-excursion - (goto-char (overlay-start (yas/snippet-overlay snippet))) - (while (re-search-forward "$>" nil t) - (replace-match "") - (indent-according-to-mode))))))) + (let ((ovst (overlay-start (yas/snippet-overlay snippet)))) + (when ovst + (goto-char ovst) + (while (re-search-forward "$>" nil t) + (replace-match "") + (indent-according-to-mode))))))))) (defun yas/current-snippet-overlay (&optional point) "Get the most proper overlay which is belongs to a snippet."