From 0eabc994222733e14a64c8d2ff786638cd58d39b Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sun, 10 Apr 2022 23:38:51 +0200 Subject: [PATCH] Update git-gutter when using magit --- config.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config.el b/config.el index ed728a8..b475e82 100644 --- a/config.el +++ b/config.el @@ -116,6 +116,19 @@ ;; Additional coniguration for doom modules. ;; ----------------------------------------------------------------------------- +;; Fix git-gutter advice for magit. +(after! (:all git-gutter magit) + ;; Define a function that updates all visible buffers. + (defun +vc-gutter-update-visible-buffers-h (&rest _) + (save-excursion + (dolist (buffer (doom-visible-buffers) nil) + (with-current-buffer buffer + (+vc-gutter-update-h))))) + + ;; And add this as new advice to the magit functions. + (advice-add 'magit-stage :after #'+vc-gutter-update-visible-buffers-h) + (advice-add 'magit-unstage :after #'+vc-gutter-update-visible-buffers-h)) + ;; Disable hl-line-mode everywhere. (after! hl-line (setq global-hl-line-modes nil))