Fix: display anzu in mode-line.

This commit is contained in:
Vincent Zhang 2018-08-13 21:57:27 +08:00
parent d9c49ac962
commit 415140b368

View file

@ -320,18 +320,18 @@ If STRICT-P, return nil if no project was found, otherwise return
;; anzu and evil-anzu expose current/total state that can be displayed in the
;; mode-line.
(eval-and-compile
(when (featurep 'anzu)
(setq anzu-cons-mode-line-p nil
anzu-minimum-input-length 1
anzu-search-threshold 250)
(eval-and-compile
(defun doom-modeline-fix-anzu-count (positions here)
(cl-loop for (start . end) in positions
collect t into before
when (and (>= here start) (<= here end))
return (length before)
finally return 0)))
finally return 0))
(advice-add #'anzu--where-is-here :override #'doom-modeline-fix-anzu-count)
@ -347,7 +347,7 @@ If STRICT-P, return nil if no project was found, otherwise return
(add-hook 'iedit-mode-end-hook #'anzu--reset-status))
(when (featurep 'evil-anzu)
(evil-ex-start-search evil-ex-start-word-search))
(evil-ex-start-search evil-ex-start-word-search)))
;; Keep `doom-modeline-current-window' up-to-date
(defvar doom-modeline-current-window (frame-selected-window))