mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-30 11:09:55 +00:00
Fix: display anzu in mode-line.
This commit is contained in:
parent
d9c49ac962
commit
415140b368
1 changed files with 18 additions and 18 deletions
|
@ -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
|
;; anzu and evil-anzu expose current/total state that can be displayed in the
|
||||||
;; mode-line.
|
;; mode-line.
|
||||||
(when (featurep 'anzu)
|
(eval-and-compile
|
||||||
|
(when (featurep 'anzu)
|
||||||
(setq anzu-cons-mode-line-p nil
|
(setq anzu-cons-mode-line-p nil
|
||||||
anzu-minimum-input-length 1
|
anzu-minimum-input-length 1
|
||||||
anzu-search-threshold 250)
|
anzu-search-threshold 250)
|
||||||
|
|
||||||
(eval-and-compile
|
|
||||||
(defun doom-modeline-fix-anzu-count (positions here)
|
(defun doom-modeline-fix-anzu-count (positions here)
|
||||||
(cl-loop for (start . end) in positions
|
(cl-loop for (start . end) in positions
|
||||||
collect t into before
|
collect t into before
|
||||||
when (and (>= here start) (<= here end))
|
when (and (>= here start) (<= here end))
|
||||||
return (length before)
|
return (length before)
|
||||||
finally return 0)))
|
finally return 0))
|
||||||
|
|
||||||
(advice-add #'anzu--where-is-here :override #'doom-modeline-fix-anzu-count)
|
(advice-add #'anzu--where-is-here :override #'doom-modeline-fix-anzu-count)
|
||||||
|
|
||||||
|
@ -346,8 +346,8 @@ If STRICT-P, return nil if no project was found, otherwise return
|
||||||
;; (add-hook '+evil-esc-hook #'anzu--reset-status t)
|
;; (add-hook '+evil-esc-hook #'anzu--reset-status t)
|
||||||
(add-hook 'iedit-mode-end-hook #'anzu--reset-status))
|
(add-hook 'iedit-mode-end-hook #'anzu--reset-status))
|
||||||
|
|
||||||
(when (featurep 'evil-anzu)
|
(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
|
;; Keep `doom-modeline-current-window' up-to-date
|
||||||
(defvar doom-modeline-current-window (frame-selected-window))
|
(defvar doom-modeline-current-window (frame-selected-window))
|
||||||
|
|
Loading…
Reference in a new issue