Bump :ui modeline

seagle0128/doom-modeline@c177959 -> seagle0128/doom-modeline@2b30885
emacsorphanage/anzu@3e34fb3 -> emacsorphanage/anzu@7b8688c
emacsorphanage/evil-anzu@9bca6ca -> emacsorphanage/evil-anzu@d3f6ed4

Fixes the anzu number-of-matches display in the modeline for isearch,
iedit, evil-search, and evil-substitution. This was caused by changes
upstream.
This commit is contained in:
Henrik Lissner 2020-05-20 02:30:14 -04:00
parent 94fc6f714f
commit 5472d46426
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 15 additions and 21 deletions

View file

@ -213,31 +213,25 @@ LHS and RHS will accept."
(use-package! anzu (use-package! anzu
:after-call isearch-mode :after-call isearch-mode
:config :config
;; anzu and evil-anzu expose current/total state that can be displayed in the ;; We manage our own modeline segments
;; mode-line. (setq anzu-cons-mode-line-p nil)
(defadvice! +modeline-fix-anzu-count-a (positions here)
"Calulate anzu counts via POSITIONS and HERE."
:override #'anzu--where-is-here
(cl-loop for (start . end) in positions
collect t into before
when (and (>= here start) (<= here end))
return (length before)
finally return 0))
(setq anzu-cons-mode-line-p nil) ; manage modeline segment ourselves
;; Ensure anzu state is cleared when searches & iedit are done ;; Ensure anzu state is cleared when searches & iedit are done
(add-hook 'isearch-mode-end-hook #'anzu--reset-status 'append)
(add-hook 'iedit-mode-end-hook #'anzu--reset-status) (add-hook 'iedit-mode-end-hook #'anzu--reset-status)
(advice-add #'evil-force-normal-state :before #'anzu--reset-status) (advice-add #'evil-force-normal-state :before #'anzu--reset-status)
;; Fix matches segment mirroring across all buffers ;; Fix matches segment mirroring across all buffers
(mapc #'make-variable-buffer-local (mapc #'make-variable-buffer-local
'(anzu--total-matched anzu--current-position anzu--state '(anzu--total-matched
anzu--cached-count anzu--cached-positions anzu--last-command anzu--current-position
anzu--last-isearch-string anzu--overflow-p))) anzu--state
anzu--cached-count
anzu--cached-positions anzu--last-command
anzu--last-isearch-string anzu--overflow-p))
(anzu-mode +1))
(use-package! evil-anzu (use-package! evil-anzu
:when (featurep! :editor evil) :when (featurep! :editor evil)
:after-call (evil-ex-start-search evil-ex-start-word-search evil-ex-search-activate-highlight)) :after-call evil-ex-start-search evil-ex-start-word-search evil-ex-search-activate-highlight)
(defun +modeline--anzu () (defun +modeline--anzu ()
"Show the match index and total number thereof. "Show the match index and total number thereof.
@ -251,7 +245,7 @@ Requires `anzu', also `evil-anzu' if using `evil-mode' for compatibility with
(cond ((eq anzu--state 'replace-query) (cond ((eq anzu--state 'replace-query)
(format " %d replace " anzu--cached-count)) (format " %d replace " anzu--cached-count))
((eq anzu--state 'replace) ((eq anzu--state 'replace)
(format " %d/%d " here total)) (format " %d/%d " (1+ here) total))
(anzu--overflow-p (anzu--overflow-p
(format " %s+ " total)) (format " %s+ " total))
(t (t

View file

@ -2,7 +2,7 @@
;;; ui/modeline/packages.el ;;; ui/modeline/packages.el
(unless (featurep! +light) (unless (featurep! +light)
(package! doom-modeline :pin "c177959bbfa7fa6f199b1145c6986e55f462f1c1")) (package! doom-modeline :pin "2b308857677e983ca4eaedc36438ed94aadf9e65"))
(package! anzu :pin "3e34fb3df53c0c68e842fa179c327a7395d1901d") (package! anzu :pin "7b8688c84d6032300d0c415182c7c1ad6cb7f819")
(when (featurep! :editor evil) (when (featurep! :editor evil)
(package! evil-anzu :pin "9bca6ca14d865e7e005bc02a28a09b4ae74facc9")) (package! evil-anzu :pin "d3f6ed4773b48767bd5f4708c7f083336a8a8a86"))