Fix presence of duplicate anzu indicator
This commit is contained in:
parent
58ea97f6ea
commit
3697ae74c8
11
mood-line.el
11
mood-line.el
@ -49,6 +49,7 @@
|
|||||||
|
|
||||||
(defvar flycheck-current-errors)
|
(defvar flycheck-current-errors)
|
||||||
(defvar flymake--mode-line-format)
|
(defvar flymake--mode-line-format)
|
||||||
|
(defvar anzu-cons-mode-line-p)
|
||||||
(defvar anzu--state)
|
(defvar anzu--state)
|
||||||
(defvar anzu--cached-count)
|
(defvar anzu--cached-count)
|
||||||
(defvar anzu--overflow-p)
|
(defvar anzu--overflow-p)
|
||||||
@ -302,8 +303,8 @@
|
|||||||
;; Activation function
|
;; Activation function
|
||||||
;;
|
;;
|
||||||
|
|
||||||
;; Store the default mode-line format
|
|
||||||
(defvar-local mood-line--default-mode-line mode-line-format)
|
(defvar-local mood-line--default-mode-line mode-line-format)
|
||||||
|
(defvar-local mood-line--anzu-cons-mode-line-p nil)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(define-minor-mode mood-line-mode
|
(define-minor-mode mood-line-mode
|
||||||
@ -323,6 +324,11 @@
|
|||||||
(add-hook 'after-save-hook #'mood-line--update-vc-segment)
|
(add-hook 'after-save-hook #'mood-line--update-vc-segment)
|
||||||
(advice-add #'vc-refresh-state :after #'mood-line--update-vc-segment)
|
(advice-add #'vc-refresh-state :after #'mood-line--update-vc-segment)
|
||||||
|
|
||||||
|
;; Disable anzu's mode-line segment setting, saving the previous setting to be restored later (if present)
|
||||||
|
(when (boundp 'anzu-cons-mode-line-p)
|
||||||
|
(setq mood-line--anzu-cons-mode-line-p anzu-cons-mode-line-p))
|
||||||
|
(setq-default anzu-cons-mode-line-p nil)
|
||||||
|
|
||||||
;; Save previous mode-line-format to be restored later
|
;; Save previous mode-line-format to be restored later
|
||||||
(setq mood-line--default-mode-line mode-line-format)
|
(setq mood-line--default-mode-line mode-line-format)
|
||||||
|
|
||||||
@ -361,6 +367,9 @@
|
|||||||
(remove-hook 'after-save-hook #'mood-line--update-vc-segment)
|
(remove-hook 'after-save-hook #'mood-line--update-vc-segment)
|
||||||
(advice-remove #'vc-refresh-state #'mood-line--update-vc-segment)
|
(advice-remove #'vc-refresh-state #'mood-line--update-vc-segment)
|
||||||
|
|
||||||
|
;; Restore anzu's mode-line segment setting
|
||||||
|
(setq-default anzu-cons-mode-line-p mood-line--anzu-cons-mode-line-p)
|
||||||
|
|
||||||
;; Restore the original mode-line format
|
;; Restore the original mode-line format
|
||||||
(setq-default mode-line-format mood-line--default-mode-line))))
|
(setq-default mode-line-format mood-line--default-mode-line))))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user