Fix some file-templates not being inserted

Because yas--lookup-snippet-1 uses the template's description, rather
than its trigger key as its lookup key. Doom expects it the other way
around, which is the case when a file template doesn't define a name: in
the snippet.
This commit is contained in:
Henrik Lissner 2018-01-01 16:11:00 -05:00
parent 1ebc4c9594
commit 14f310e199
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -29,7 +29,10 @@
(unless yas-minor-mode (unless yas-minor-mode
(yas-minor-mode-on)) (yas-minor-mode-on))
(when (and yas-minor-mode (when (and yas-minor-mode
(yas-expand-snippet (yas-lookup-snippet key mode t)) (yas-expand-snippet
(yas--template-content
(cl-find key (yas--all-templates (yas--get-snippet-tables mode))
:key #'yas--template-key :test #'equal)))
(and (featurep 'evil) evil-mode) (and (featurep 'evil) evil-mode)
(and yas--active-field-overlay (and yas--active-field-overlay
(overlay-buffer yas--active-field-overlay) (overlay-buffer yas--active-field-overlay)