From 5472d46426a8ecd0ff8745859f8ec9208b9ce9ce Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 20 May 2020 02:30:14 -0400 Subject: [PATCH] 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. --- modules/ui/modeline/+light.el | 30 ++++++++++++------------------ modules/ui/modeline/packages.el | 6 +++--- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/modules/ui/modeline/+light.el b/modules/ui/modeline/+light.el index 4fa18a150..8b14528a9 100644 --- a/modules/ui/modeline/+light.el +++ b/modules/ui/modeline/+light.el @@ -213,31 +213,25 @@ LHS and RHS will accept." (use-package! anzu :after-call isearch-mode :config - ;; anzu and evil-anzu expose current/total state that can be displayed in the - ;; mode-line. - (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 + ;; We manage our own modeline segments + (setq anzu-cons-mode-line-p nil) ;; 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) (advice-add #'evil-force-normal-state :before #'anzu--reset-status) ;; Fix matches segment mirroring across all buffers (mapc #'make-variable-buffer-local - '(anzu--total-matched anzu--current-position anzu--state - anzu--cached-count anzu--cached-positions anzu--last-command - anzu--last-isearch-string anzu--overflow-p))) + '(anzu--total-matched + anzu--current-position + 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 :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 () "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) (format " %d replace " anzu--cached-count)) ((eq anzu--state 'replace) - (format " %d/%d " here total)) + (format " %d/%d " (1+ here) total)) (anzu--overflow-p (format " %s+ " total)) (t diff --git a/modules/ui/modeline/packages.el b/modules/ui/modeline/packages.el index 8e843630b..dc4fa370b 100644 --- a/modules/ui/modeline/packages.el +++ b/modules/ui/modeline/packages.el @@ -2,7 +2,7 @@ ;;; ui/modeline/packages.el (unless (featurep! +light) - (package! doom-modeline :pin "c177959bbfa7fa6f199b1145c6986e55f462f1c1")) -(package! anzu :pin "3e34fb3df53c0c68e842fa179c327a7395d1901d") + (package! doom-modeline :pin "2b308857677e983ca4eaedc36438ed94aadf9e65")) +(package! anzu :pin "7b8688c84d6032300d0c415182c7c1ad6cb7f819") (when (featurep! :editor evil) - (package! evil-anzu :pin "9bca6ca14d865e7e005bc02a28a09b4ae74facc9")) + (package! evil-anzu :pin "d3f6ed4773b48767bd5f4708c7f083336a8a8a86"))