]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix #70
authorJoão Távora <joaotavora@gmail.com>
Mon, 16 Jul 2012 13:13:42 +0000 (14:13 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 16 Jul 2012 13:13:42 +0000 (14:13 +0100)
yasnippet.el

index 3d0da8a5b2feb953ec93e0443eb77bedfb2938bb..1d304f5fc691ec031e0c70f08b68c26603f538c3 100644 (file)
@@ -1630,8 +1630,10 @@ TEMPLATES is a list of `yas/template'."
                                'require-match
                                nil
                                nil)))
-    (when chosen
-      (nth (position chosen formatted-choices :test #'string=) filtered-choices))))
+    (let ((position (or (and chosen
+                             (position chosen formatted-choices :test #'string=))
+                        0)))
+      (nth position filtered-choices))))
 
 (defun yas/no-prompt (prompt choices &optional display-fn)
   (first choices))