branch: externals/ivy-hydra
commit 1bf5b98dc2a01ff4d3255e349cf32817ffaccea1
Author: Martin Renold <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el: Fix next-error randomly jumping to previous match
Fixes #2492
Fixes #2496
Problem happens only when *ivy-occur ...* is not the active window.
Explanation of the problem:
https://emacs.stackexchange.com/questions/21464/how-to-persistently-move-the-cursor-in-a-buffer-other-than-the-current-one/21478
---
ivy.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ivy.el b/ivy.el
index 690e446..cdea3c0 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4995,7 +4995,10 @@ When `ivy-calling' isn't nil, call `ivy-occur-press'."
(setq n (or n 1))
(let ((ivy-calling t))
(cond ((< n 0) (ivy-occur-previous-line (- n)))
- (t (ivy-occur-next-line n)))))
+ (t (ivy-occur-next-line n))))
+ ;; the window's point overrides the buffer's point every time it's
redisplayed
+ (cl-dolist (window (get-buffer-window-list nil nil t))
+ (set-window-point window (point))))
(define-derived-mode ivy-occur-mode fundamental-mode "Ivy-Occur"
"Major mode for output from \\[ivy-occur].