summaryrefslogtreecommitdiff
path: root/helm-utils.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2016-12-31 10:08:20 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2016-12-31 10:08:20 +0100
commitaa0a15f2cfb3565f60b392aea868693f25a16d12 (patch)
tree72ebd6d826d850604ea9b6c3bde9c01bb1ff2981 /helm-utils.el
parent1f2733ecab5c09934edf2b167af2cbbf9f210a8c (diff)
Cleanup overlays when helm-buffer is empty.
* helm-utils.el (helm-match-line-cleanup-maybe): New. Run it in helm-after-update-hook.
Diffstat (limited to 'helm-utils.el')
-rw-r--r--helm-utils.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/helm-utils.el b/helm-utils.el
index 47986cad..ea837d00 100644
--- a/helm-utils.el
+++ b/helm-utils.el
@@ -666,6 +666,10 @@ Assume regexp is a pcre based regexp."
(when helm--match-item-overlays
(mapc 'delete-overlay helm--match-item-overlays)))
+(defun helm-match-line-cleanup-maybe ()
+ (when (helm-empty-buffer-p)
+ (helm-match-line-cleanup)))
+
(defun helm-match-line-update ()
(when helm-match-line-overlay
(delete-overlay helm-match-line-overlay)
@@ -680,6 +684,7 @@ Assume regexp is a pcre based regexp."
(defun helm-match-line-cleanup-pulse ()
(run-with-timer 0.3 nil #'helm-match-line-cleanup))
+(add-hook 'helm-after-update-hook 'helm-match-line-cleanup-maybe)
(add-hook 'helm-after-persistent-action-hook 'helm-persistent-autoresize-hook)
(add-hook 'helm-cleanup-hook 'helm-match-line-cleanup)
(add-hook 'helm-after-action-hook 'helm-match-line-cleanup-pulse)