Fix "Select a root directory" prompts
Occurs when :feature snippets is disabled, but :feature file-templates is enabled.
This commit is contained in:
parent
f9b06bd3a8
commit
40eda029ab
1 changed files with 11 additions and 18 deletions
|
@ -124,22 +124,15 @@ must be non-read-only, empty, and there must be a rule in
|
|||
;; Bootstrap
|
||||
;;
|
||||
|
||||
(def-package! yasnippet
|
||||
:unless (featurep! :feature snippets)
|
||||
:config
|
||||
(setq yas-verbosity (if doom-debug-mode 3 0)
|
||||
yas-prompt-functions (delq #'yas-dropdown-prompt yas-prompt-functions)
|
||||
yas-snippet-dirs nil)
|
||||
(after! yasnippet
|
||||
(if (featurep! :feature snippets)
|
||||
(add-to-list 'yas-snippet-dirs '+file-templates-dir 'append #'eq)
|
||||
(setq yas-prompt-functions (delq #'yas-dropdown-prompt yas-prompt-functions)
|
||||
yas-snippet-dirs '(+file-templates-dir))
|
||||
;; Exit snippets on ESC from normal mode
|
||||
(add-hook 'doom-escape-hook #'yas-abort-snippet)
|
||||
;;
|
||||
(yas-reload-all))
|
||||
|
||||
|
||||
(defun +file-templates|init ()
|
||||
(after! yasnippet
|
||||
(add-to-list 'yas-snippet-dirs '+file-templates-dir 'append #'eq))
|
||||
(add-hook 'find-file-hook #'+file-templates|check))
|
||||
|
||||
(add-hook 'doom-post-init-hook #'+file-templates|init)
|
||||
;; Ensure file templates in `+file-templates-dir' are visible
|
||||
(yas-reload-all)))
|
||||
|
||||
;;
|
||||
(add-hook 'find-file-hook #'+file-templates|check)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue