fix a bug in condition system.

This commit is contained in:
Zhang Chiyuan 2008-05-01 03:21:32 +00:00
parent db6a74078f
commit 0e1456f4b8
2 changed files with 15 additions and 12 deletions

View File

@ -1,4 +1,5 @@
#name : if ... end
#condition : (looking-back "^[[:blank:]]*if")
# --
if ${1:condition}
$0

View File

@ -367,17 +367,19 @@ have, compare through the start point of the overlay."
* If the template has no condition, it is kept.
* If the template's condition eval to non-nil, it is kept.
* Otherwise (eval error or eval to nil) it is filtered."
(remove-if '(lambda (pair)
(remove-if-not '(lambda (pair)
(let ((condition (yas/template-condition (cdr pair))))
(if (null condition)
(if yas/require-template-condition
t
nil)
nil
t)
(let ((result
(yas/template-condition-predicate condition)))
(if yas/require-template-condition
(if (eq yas/require-template-condition t)
result
(not (eq result yas/require-template-condition)))))))
(eq result yas/require-template-condition))
result)))))
templates))
(defun yas/snippet-table-fetch (table key)