branch: elpa/helm
commit dc8659267230027aa16cb14692b4fc996175ca66
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
Ensure to not reuse helm-current-buffer value
when jumping to helm-occur from isl or isearch.
---
helm-occur.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/helm-occur.el b/helm-occur.el
index 912e238aa4b..f523b0f122f 100644
--- a/helm-occur.el
+++ b/helm-occur.el
@@ -414,7 +414,16 @@ helm-occur will start immediately with DEFAULT as INPUT.
Always prefer using DEFAULT instead of INPUT, they have the same effect but
DEFAULT keep the minibuffer empty, allowing the user to write immediately
without having to delete its contents before."
- (let* ((curbuf (get-buffer (or helm-current-buffer (current-buffer))))
+ (let* ((curbuf (get-buffer (if helm-alive-p
+ ;; We are starting from a helm session listing
+ ;; buffers, presumably helm-buffers-list or
+ ;; helm-mini. If we don't check for
+ ;; helm-alive-p and helm-multi-occur-1 is
+ ;; launched from e.g. isl or isearch we may
+ ;; reuse a old helm-current-buffer value from
+ ;; last helm-session.
+ helm-current-buffer
+ (current-buffer))))
(bufs (if (or helm-occur-always-search-in-current
(memql curbuf buffers))
(cons curbuf (remove curbuf buffers))