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
|
;; Bootstrap
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(def-package! yasnippet
|
(after! yasnippet
|
||||||
:unless (featurep! :feature snippets)
|
(if (featurep! :feature snippets)
|
||||||
:config
|
(add-to-list 'yas-snippet-dirs '+file-templates-dir 'append #'eq)
|
||||||
(setq yas-verbosity (if doom-debug-mode 3 0)
|
(setq yas-prompt-functions (delq #'yas-dropdown-prompt yas-prompt-functions)
|
||||||
yas-prompt-functions (delq #'yas-dropdown-prompt yas-prompt-functions)
|
yas-snippet-dirs '(+file-templates-dir))
|
||||||
yas-snippet-dirs nil)
|
;; Exit snippets on ESC from normal mode
|
||||||
;; Exit snippets on ESC from normal mode
|
(add-hook 'doom-escape-hook #'yas-abort-snippet)
|
||||||
(add-hook 'doom-escape-hook #'yas-abort-snippet)
|
;; Ensure file templates in `+file-templates-dir' are visible
|
||||||
;;
|
(yas-reload-all)))
|
||||||
(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)
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
(add-hook 'find-file-hook #'+file-templates|check)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue