branch: master
commit 1a74a217813e3fb1aec4b2283c799e17a8f0a1bd
Author: Nathan Moreau <[email protected]>
Commit: Nathan Moreau <[email protected]>
ivy-occur: setup for next-error.
* ivy.el (ivy-occur): set next-error-last-buffer.
This change allows to use next-error and previous-error as
a replacement for ivy-occur-toggle-calling, ivy-occur-next-line and
ivy-occur-previous-line.
For example with next-error and bound to M-n and M-p:
- "C-h f" (`describe-funtion')
- "run" (`self-insert-command')
- "C-c C-o" (`ivy-occur'); "C-o u" also works.
- "M-n M-n M-n M-k M-k M-k"
---
ivy.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ivy.el b/ivy.el
index 0c94070..9fc579d 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4732,7 +4732,9 @@ There is no limit on the number of *ivy-occur* buffers."
(setf (ivy-state-text ivy-last) ivy-text)
(setq ivy-occur-last ivy-last))
(ivy-exit-with-action
- (lambda (_) (pop-to-buffer buffer))))))
+ (lambda (_)
+ (pop-to-buffer buffer)
+ (setq next-error-last-buffer buffer))))))
(defun ivy-occur-revert-buffer ()
"Refresh the buffer making it up-to date with the collection.