From 98273b639b151bc4fd2bc95474346814e5dce23d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 2 Apr 2025 06:36:27 -0400 Subject: [PATCH] fix: recursive redisplay error from doom-switch-frame-hook If a function on doom-switch-frame-hook triggered a redisplay, it could cause infinite recursion. Amend: 653b465c74b2 --- lisp/doom-ui.el | 3 ++- modules/ui/vc-gutter/config.el | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/doom-ui.el b/lisp/doom-ui.el index 52c4d6bbb..5e64d48d9 100644 --- a/lisp/doom-ui.el +++ b/lisp/doom-ui.el @@ -132,7 +132,8 @@ the frame through some other means.") doom-switch-frame-hook-debounce-delay)) (with-selected-frame fr (unwind-protect - (run-hooks 'doom-switch-frame-hook) + (let ((inhibit-redisplay t)) + (run-hooks 'doom-switch-frame-hook)) (set-frame-parameter fr '+last-focus (current-time))))))))))) (let (last-focus-state) diff --git a/modules/ui/vc-gutter/config.el b/modules/ui/vc-gutter/config.el index 9f6e08df2..0b6911d2f 100644 --- a/modules/ui/vc-gutter/config.el +++ b/modules/ui/vc-gutter/config.el @@ -123,10 +123,9 @@ Respects `diff-hl-disable-on-remote'." (add-hook! '(doom-escape-hook doom-switch-window-hook doom-switch-frame-hook) :append (defun +vc-gutter-update-h (&rest _) "Return nil to prevent shadowing other `doom-escape-hook' hooks." - (ignore (or inhibit-redisplay - (and (or (bound-and-true-p diff-hl-mode) - (bound-and-true-p diff-hl-dir-mode)) - (diff-hl-update-once)))))) + (ignore (and (or (bound-and-true-p diff-hl-mode) + (bound-and-true-p diff-hl-dir-mode)) + (diff-hl-update-once))))) ;; UX: Update diff-hl when magit alters git state. (when (modulep! :tools magit) (add-hook 'magit-post-refresh-hook #'diff-hl-magit-post-refresh))