Fix stringp error when inserting new snippets #852
New snippets (created with yas-new-snippet) may not yet be associated with a file when it is passed to the functions in yas-prompt-functions. One of those functions, +snippets-prompt-private, prioritizes private snippets over default ones, but determines which is which with `file-in-directory-p`, which expects string arguments. To fix this, we can safely assume that if a snippet has no associated file, it is a private snippet.
This commit is contained in:
parent
33d692a6be
commit
68e2b814e7
1 changed files with 3 additions and 2 deletions
|
@ -7,8 +7,9 @@ are multiple choices."
|
|||
(when-let*
|
||||
((choices
|
||||
(or (cl-loop for tpl in choices
|
||||
if (file-in-directory-p (yas--template-get-file tpl)
|
||||
+snippets-dir)
|
||||
for file = (yas--template-get-file tpl)
|
||||
if (or (null file)
|
||||
(file-in-directory-p file +snippets-dir))
|
||||
collect tpl)
|
||||
choices)))
|
||||
(if (cdr choices)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue