From 023c2ec72ced54d56d2f507bcb2f28ef0b97590e Mon Sep 17 00:00:00 2001 From: StrawberryTea Date: Tue, 20 Feb 2024 15:32:32 -0600 Subject: [PATCH] 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. --- lisp/doom-keybinds.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/doom-keybinds.el b/lisp/doom-keybinds.el index 3f4532515..5940ce43a 100644 --- a/lisp/doom-keybinds.el +++ b/lisp/doom-keybinds.el @@ -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)