From 14f310e199b7675bb506dd9fe52699fbeefb0260 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 1 Jan 2018 16:11:00 -0500 Subject: [PATCH] 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. --- modules/feature/file-templates/config.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/feature/file-templates/config.el b/modules/feature/file-templates/config.el index 72c4dcc40..857a4f9d6 100644 --- a/modules/feature/file-templates/config.el +++ b/modules/feature/file-templates/config.el @@ -29,7 +29,10 @@ (unless yas-minor-mode (yas-minor-mode-on)) (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 yas--active-field-overlay (overlay-buffer yas--active-field-overlay)