[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master bfdda68 111/184: swiper.el (swiper-occur): Use ivy-occur-n
From: |
Oleh Krehel |
Subject: |
[elpa] master bfdda68 111/184: swiper.el (swiper-occur): Use ivy-occur-next-error |
Date: |
Wed, 16 Oct 2019 13:15:01 -0400 (EDT) |
branch: master
commit bfdda682b3cf29ea335533fc000f04f8d7960904
Author: Nathan Moreau <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper-occur): Use ivy-occur-next-error
* ivy.el (ivy-occur-next-error): Add.
This change ensures that next-error and previous-error work
for swiper even for buffer that do not visit a file.
Fixes #2257
Fixes #1354
---
ivy.el | 10 ++++++++++
swiper.el | 3 ++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/ivy.el b/ivy.el
index 9fc579d..ccd53ff 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4636,6 +4636,16 @@ When `ivy-calling' isn't nil, call `ivy-occur-press'."
(ivy-occur-previous-line arg)
(ivy-occur-press-and-switch))))
+(defun ivy-occur-next-error (n &optional reset)
+ "A `next-error-function' for `ivy-occur-mode'."
+ (interactive "p")
+ (when reset
+ (goto-char (point-min)))
+ (setq n (or n 1))
+ (let ((ivy-calling t))
+ (cond ((< n 0) (ivy-occur-previous-line (- n)))
+ (t (ivy-occur-next-line n)))))
+
(define-derived-mode ivy-occur-mode fundamental-mode "Ivy-Occur"
"Major mode for output from \\[ivy-occur].
diff --git a/swiper.el b/swiper.el
index 5e73ba4..af60c5c 100644
--- a/swiper.el
+++ b/swiper.el
@@ -677,7 +677,8 @@ When capture groups are present in the input, print them
instead of lines."
(lambda (cand) (concat "./" cand))
cands))
(goto-char (point-min))
- (forward-line 4))))
+ (forward-line 4)
+ (setq-local next-error-function #'ivy-occur-next-error))))
(ivy-set-occur 'swiper 'swiper-occur)
- [elpa] master 3b4956a 123/184: counsel.el (counsel-evil-registers-height): Remove obsolete var, (continued)
- [elpa] master 3b4956a 123/184: counsel.el (counsel-evil-registers-height): Remove obsolete var, Oleh Krehel, 2019/10/16
- [elpa] master a1bb702 128/184: Nicer message when counsel-git-grep finds no match, Oleh Krehel, 2019/10/16
- [elpa] master 5d2938f 126/184: counsel.el (counsel-git-grep): Works with ivy--regex-fuzzy, Oleh Krehel, 2019/10/16
- [elpa] master 3a37741 147/184: swiper.el (swiper--update-input-ivy): Set case-fold-search, Oleh Krehel, 2019/10/16
- [elpa] master dea98fc 153/184: ivy.el (ivy-inhibit-action): Clean up docstring, Oleh Krehel, 2019/10/16
- [elpa] master 92f54f6 150/184: ivy.el (ivy-configure): Add :grep-p, Oleh Krehel, 2019/10/16
- [elpa] master abe5aa8 006/184: ivy.el (ivy-resume): Select original buffer for search functions, Oleh Krehel, 2019/10/16
- [elpa] master bfe4454 021/184: Fix swiper--isearch-filter-ignore-order return value, Oleh Krehel, 2019/10/16
- [elpa] master bb65c4e 039/184: swiper.el (swiper--current-window-start): Refactor, Oleh Krehel, 2019/10/16
- [elpa] master 76fff20 114/184: counsel-M-x: Propertize names of active modes., Oleh Krehel, 2019/10/16
- [elpa] master bfdda68 111/184: swiper.el (swiper-occur): Use ivy-occur-next-error,
Oleh Krehel <=
- [elpa] master 84e1ab8 117/184: counsel.el (counsel-package): Refresh contents automatically, Oleh Krehel, 2019/10/16
- [elpa] master 9d3d7de 132/184: counsel.el (counsel-slime-repl-history): Add., Oleh Krehel, 2019/10/16
- [elpa] master 9e1b9a0 131/184: counsel.el (counsel-google-function): Add missing require, Oleh Krehel, 2019/10/16
- [elpa] master 5ff8b5e 133/184: ivy.el (ivy-completion-in-region-action): Use declare-function., Oleh Krehel, 2019/10/16
- [elpa] master 78dd554 134/184: ivy.el (ivy--exhibit): Handle ivy--reset-state initial call, Oleh Krehel, 2019/10/16
- [elpa] master c1ea2af 145/184: ivy.el (ivy-read): Fix conflict an existing read-key session, Oleh Krehel, 2019/10/16
- [elpa] master 589e03f 144/184: ivy.el (ivy-configure): Use for ivy-index-functions-alist, Oleh Krehel, 2019/10/16
- [elpa] master 64c0804 163/184: ivy.el (ivy-partial-or-done): Work with completion-cycle-threshold, Oleh Krehel, 2019/10/16
- [elpa] master 6f23c5e 152/184: ivy.el (ivy-occur-press): Re-use ivy-highlight-grep-commands, Oleh Krehel, 2019/10/16
- [elpa] master f46cdad 154/184: counsel.el (counsel-grep): Add :require-match, Oleh Krehel, 2019/10/16