From 97f8594a71d9bac27b9b5147ad541be097d045de Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 18 Oct 2018 13:13:35 -0400 Subject: [PATCH] ui/modeline: refresh +modeline-buffer-state often This fixes issues where the buffer's modified state isn't reflected properly in the mode-line, at the expense of a little (but acceptable loss of) efficiency. --- modules/ui/modeline/config.el | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/modules/ui/modeline/config.el b/modules/ui/modeline/config.el index ebdc6ae40..42cb59644 100644 --- a/modules/ui/modeline/config.el +++ b/modules/ui/modeline/config.el @@ -402,22 +402,7 @@ Meant for `+modeline-buffer-path-function'." ;; ;; Segments -(defun +modeline|update-on-change () - (+modeline--set-+modeline-buffer-state) - (remove-hook 'post-command-hook #'+modeline|update-on-change t)) -(defun +modeline|start-update-on-change () - (add-hook 'post-command-hook #'+modeline|update-on-change nil t)) -(add-hook 'first-change-hook #'+modeline|start-update-on-change) - -(advice-add #'undo :after #'+modeline--set-+modeline-buffer-state) -(advice-add #'undo-tree-undo :after #'+modeline--set-+modeline-buffer-state) - (def-modeline-segment! +modeline-buffer-state - :on-hooks (find-file-hook - read-only-mode-hook - after-change-functions - after-save-hook - after-revert-hook) (let* ((base (buffer-base-buffer)) (icon (cond (buffer-read-only (all-the-icons-octicon