From 6527a1c8148c69b730d8d5517ee48fede5720f21 Mon Sep 17 00:00:00 2001 From: larstvei Date: Tue, 24 Sep 2024 08:19:27 +0200 Subject: [PATCH] Add center-content-update to hooks --- center-content-mode.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/center-content-mode.el b/center-content-mode.el index 8eac566..c567b1f 100644 --- a/center-content-mode.el +++ b/center-content-mode.el @@ -144,8 +144,13 @@ and vertically within the window." :global nil :lighter " Center" (if center-content-mode - (center-content--enable) - (center-content--disable))) + (progn + (center-content--enable) + (add-hook 'post-command-hook #'center-content-update 50 t) + (add-hook 'window-configuration-change-hook #'center-content-update 50 t)) + (center-content--disable) + (remove-hook 'post-command-hook #'center-content-update t) + (remove-hook 'window-configuration-change-hook #'center-content-update t))) (provide 'center-content-mode)