perf(org): call yas-reload-all on TAB only once
In cases where the user has an empty snippets library (or no snippets for the mode at point), the expensive `yas-reload-all` function would be called each time you press tab. Fix: #8025
This commit is contained in:
parent
d6f5fed4a4
commit
67a516cf0d
1 changed files with 2 additions and 1 deletions
|
@ -486,7 +486,8 @@ Made for `org-tab-first-hook'."
|
||||||
(evil-emacs-state-p))
|
(evil-emacs-state-p))
|
||||||
(or (and (bound-and-true-p yas--tables)
|
(or (and (bound-and-true-p yas--tables)
|
||||||
(gethash major-mode yas--tables))
|
(gethash major-mode yas--tables))
|
||||||
(progn (yas-reload-all) t))
|
(with-memoization (get 'yas-reload-all 'reloaded)
|
||||||
|
(always (yas-reload-all))))
|
||||||
(yas--templates-for-key-at-point))
|
(yas--templates-for-key-at-point))
|
||||||
(yas-expand)
|
(yas-expand)
|
||||||
t)
|
t)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue