mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-31 14:43:40 -05:00
Lazy-load yasnippet harder for faster first-file load time
+ Rather than waiting for the first "interactive" major mode to be visited to activate yas-minor-mode, we wait until the first time the user invokes a snippet command to activate yas-global-mode. + yas-reload-all is one of the bottlenecks when loading a file for the first time. Deferring it further should help with this. + yas-global-mode reaches more major modes than our former list of hooks (fixes #5140). Closes #5140
This commit is contained in:
@@ -417,7 +417,8 @@ Made for `org-tab-first-hook' in evil-mode."
|
||||
(defun +org-yas-expand-maybe-h ()
|
||||
"Expand a yasnippet snippet, if trigger exists at point or region is active.
|
||||
Made for `org-tab-first-hook'."
|
||||
(when (bound-and-true-p yas-minor-mode)
|
||||
(when (featurep! :editor snippets)
|
||||
(require 'yasnippet)
|
||||
(and (let ((major-mode (if (org-in-src-block-p t)
|
||||
(org-src-get-lang-mode (org-eldoc-get-src-lang))
|
||||
major-mode))
|
||||
|
Reference in New Issue
Block a user