Fix #2639: duplicate snippets in completion prompt

This commit is contained in:
Henrik Lissner 2020-06-05 02:52:18 -04:00
parent 5b8b04f0c8
commit b2919ee5d6
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -87,6 +87,12 @@
[remap yas-new-snippet] #'+snippets/new
[remap yas-visit-snippet-file] #'+snippets/edit)
;; REVIEW Fix #2639: For some reason `yas--all-templates' returns duplicates
;; of some templates. Until I figure out the real cause this fixes it.
(defadvice! +snippets--remove-duplicates-a (templates)
:filter-return #'yas--all-templates
(cl-delete-duplicates templates :test #'equal))
;; If in a daemon session, front-load this expensive work:
(if (daemonp) (yas-reload-all)))