fix(lsp): gate gcmh API call behind gcmh-mode check

In case the mode is activated before gcmh is loaded (as is the case with
session persistance libraries like desktop.el or
persp{ective,-mode}.el).

Close: #8372
This commit is contained in:
Henrik Lissner
2025-04-23 05:37:27 -04:00
parent 9cbb8656cb
commit da32e8e6f2

View File

@ -35,7 +35,8 @@ killing and opening many LSP/eglot-powered buffers.")
;; so we modify its variables rather than `gc-cons-threshold'
;; directly.
(setq-default gcmh-high-cons-threshold (* 2 +lsp--default-gcmh-high-cons-threshold))
(gcmh-set-high-threshold)
(when (bound-and-true-p gcmh-mode)
(gcmh-set-high-threshold))
(setq +lsp--optimization-init-p t))))