From 19dd43cb52430111caa8fedc6c1709a0cb1ccf2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 16 Jul 2012 14:13:42 +0100 Subject: [PATCH] Fix #70 --- yasnippet.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/yasnippet.el b/yasnippet.el index 3d0da8a..1d304f5 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -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))