Optimize buffer normalization in switch hooks
get-buffer is faster than window-normalize-buffer-to-switch-to.
This commit is contained in:
parent
99afb01315
commit
ab98020295
1 changed files with 2 additions and 2 deletions
|
@ -386,10 +386,10 @@ from the default."
|
||||||
(run-hooks 'doom-after-switch-window-hook)))))
|
(run-hooks 'doom-after-switch-window-hook)))))
|
||||||
(defun doom*switch-buffer-hooks (orig-fn buffer-or-name &rest args)
|
(defun doom*switch-buffer-hooks (orig-fn buffer-or-name &rest args)
|
||||||
(if (or doom-inhibit-switch-buffer-hooks
|
(if (or doom-inhibit-switch-buffer-hooks
|
||||||
(eq (window-normalize-buffer-to-switch-to buffer-or-name)
|
(eq (get-buffer buffer-or-name)
|
||||||
(current-buffer)))
|
(current-buffer)))
|
||||||
(apply orig-fn buffer-or-name args)
|
(apply orig-fn buffer-or-name args)
|
||||||
(let ((dest (window-normalize-buffer-to-switch-to buffer-or-name)))
|
(let ((dest (get-buffer buffer-or-name)))
|
||||||
(run-hooks 'doom-before-switch-buffer-hook)
|
(run-hooks 'doom-before-switch-buffer-hook)
|
||||||
(prog1
|
(prog1
|
||||||
(let ((doom-inhibit-switch-buffer-hooks t))
|
(let ((doom-inhibit-switch-buffer-hooks t))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue