fix: use window-buffer instead of current-buffer

This is because immediately after switching persps or using similar
commands, the current-buffer is not the buffer that is displayed in the
window.
This commit is contained in:
StrawberryTea 2024-02-20 15:32:32 -06:00
parent 167911ba7b
commit 023c2ec72c

View file

@ -242,7 +242,8 @@ localleader prefix."
(defun doom-update-localleader-key-h ()
"Set the localleader keys for the current major-mode."
(set-keymap-parent doom-localleader-map
(cdr (assq major-mode doom-localleader-map-alist))))
(cdr (assq (buffer-local-value 'major-mode (window-buffer))
doom-localleader-map-alist))))
(add-hook 'post-command-hook #'doom-update-localleader-key-h)