From 286af87c7c88da46e383e11db7ad3f14b01d05ab Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Fri, 3 Oct 2014 22:20:07 -0400 Subject: [PATCH] Improve ahs micro-state minibuffer info Face now make the counter of occurrences stands out A star is displayed if some occurrences are not displayed on the current window --- spacemacs/extensions.el | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/spacemacs/extensions.el b/spacemacs/extensions.el index 3259a4a7b..91b9cd5b4 100644 --- a/spacemacs/extensions.el +++ b/spacemacs/extensions.el @@ -88,9 +88,19 @@ (while (not (string= overlay current-overlay)) (setq i (1+ i)) (setq overlay (format "%s" (nth i ahs-overlay-list)))) - (if display - (message "[%s/%s] press (n) or (N) to navigate, (h) for home symbol, (c) to change scope" - (- overlay-count i) overlay-count))))))) + (unless (not display) + (if (or (< (point) (window-start)) (> (point) (window-end))) + ;; redisplay only if point leave the window + ;; this way the next call to ahs-stat will compute up to + ;; date values + (redisplay)) + (let* ((st (ahs-stat)) + (x/y (format "[%s/%s]" (- overlay-count i) overlay-count)) + (propx/y (propertize x/y 'face ahs-plugin-whole-buffer-face)) + (hidden (if (< 0 (- overlay-count (nth 4 st))) "*" "")) + (prophidden (propertize hidden 'face '(:weight bold)))) + (message "%s%s press (n) or (N) to navigate, (h) for home symbol, (c) to change scope" + propx/y prophidden)))))))) (defun spacemacs/init-centered-cursor () (use-package centered-cursor-mode