* Fix Issue 151: yas-parents not working

This commit is contained in:
capitaomorte 2010-10-25 09:59:35 +00:00
parent f8060ec2a5
commit 04c1a6e23a

View File

@ -455,17 +455,18 @@ the trigger key itself."
(defvar yas/key-syntaxes (list "w" "w_" "w_." "w_.()" "^ ") (defvar yas/key-syntaxes (list "w" "w_" "w_." "w_.()" "^ ")
"List of character syntaxes used to find a trigger key before point. "List of character syntaxes used to find a trigger key before point.
Scanning backwards for a key, this list is tried in the The list is tried in the order while scanning characters
order. For example, if the list is '(\"w\" \"w_\") first look backwards from point. For example, if the list is '(\"w\" \"w_\")
trigger keys which are composed exclusively of \"word\"-syntax first look for trigger keys which are composed exclusively of
characters, and then, if that fails, look for keys which are \"word\"-syntax characters, and then, if that fails, look for
either of \"word\" or \"symbol\" syntax. So triggering after keys which are either of \"word\" or \"symbol\"
triggering after: syntax. Triggering after
foo-bar foo-bar
will first try \"bar\", if that trigger key isn't found found, will, according to the \"w\" element first try \"bar\". If that
\"foo-bar\" is tried.") isn't a trigger key, \"foo-bar\" is tried, respecting a second
\"w_\" element.")
(defvar yas/after-exit-snippet-hook (defvar yas/after-exit-snippet-hook
'() '()
@ -1651,7 +1652,8 @@ TEMPLATES is a list of `yas/template'."
(insert-file-contents file nil nil nil t) (insert-file-contents file nil nil nil t)
(push (yas/parse-template file) (push (yas/parse-template file)
snippet-defs)))) snippet-defs))))
(when snippet-defs (when (or snippet-defs
(cdr major-mode-and-parents))
(yas/define-snippets (car major-mode-and-parents) (yas/define-snippets (car major-mode-and-parents)
snippet-defs snippet-defs
(cdr major-mode-and-parents))) (cdr major-mode-and-parents)))