[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c82b852 174/184: ivy.el (ivy-occur-revert-buffer): Simplif
From: |
Oleh Krehel |
Subject: |
[elpa] master c82b852 174/184: ivy.el (ivy-occur-revert-buffer): Simplify |
Date: |
Wed, 16 Oct 2019 13:15:17 -0400 (EDT) |
branch: master
commit c82b852d30e9d6385116bd9177f1598ab27de287
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy-occur-revert-buffer): Simplify
Re #2203
---
ivy.el | 19 +++++++------------
swiper.el | 5 ++---
2 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/ivy.el b/ivy.el
index 8073665..bdc3e2e 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4810,18 +4810,13 @@ updated original buffer."
(interactive)
(let ((caller (ivy-state-caller ivy-occur-last))
(ivy-last ivy-occur-last))
- (cond ((member caller '(swiper swiper-isearch))
- (let ((inhibit-read-only t))
- (erase-buffer)
- (funcall (plist-get ivy--occurs-list caller) t)
- (ivy-occur-grep-mode)))
- ((memq caller ivy-highlight-grep-commands)
- (let ((inhibit-read-only t)
- (line (line-number-at-pos)))
- (erase-buffer)
- (funcall (plist-get ivy--occurs-list caller))
- (goto-char (point-min))
- (forward-line (1- line)))))
+ (when (memq caller (append '(swiper swiper-isearch)
ivy-highlight-grep-commands))
+ (let ((inhibit-read-only t)
+ (line (line-number-at-pos)))
+ (erase-buffer)
+ (funcall (plist-get ivy--occurs-list caller))
+ (goto-char (point-min))
+ (forward-line (1- line))))
(setq ivy-occur-last ivy-last)))
(declare-function wgrep-change-to-wgrep-mode "ext:wgrep")
diff --git a/swiper.el b/swiper.el
index 964ea51..0d97bc1 100644
--- a/swiper.el
+++ b/swiper.el
@@ -652,9 +652,8 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
(setf (ivy-state-window ivy-last) (selected-window)))
buffer))
-(defun swiper-occur (&optional revert)
+(defun swiper-occur ()
"Generate a custom occur buffer for `swiper'.
-When REVERT is non-nil, regenerate the current *ivy-occur* buffer.
When capture groups are present in the input, print them instead of lines."
(let* ((buffer (swiper--occur-buffer))
(fname (propertize
@@ -671,7 +670,7 @@ When capture groups are present in the input, print them
instead of lines."
(cands
(swiper--occur-cands
fname
- (if (not revert)
+ (if (not (eq this-command 'ivy-occur-revert-buffer))
ivy--old-cands
(setq ivy--old-re nil)
(save-window-excursion
- [elpa] master 0dfd70d 135/184: counsel.el (counsel-google-function): Require json, (continued)
- [elpa] master 0dfd70d 135/184: counsel.el (counsel-google-function): Require json, Oleh Krehel, 2019/10/16
- [elpa] master eed1f06 138/184: counsel.el (counsel--py-action): Don't auto-insert parens, Oleh Krehel, 2019/10/16
- [elpa] master 52295c4 137/184: swiper.el (swiper-isearch): Fix searching for "$^", Oleh Krehel, 2019/10/16
- [elpa] master 80c2669 142/184: ivy.el (ivy--alist-set): Work-around emacs-24.3 not having alist-get, Oleh Krehel, 2019/10/16
- [elpa] master 8b07572 149/184: ivy.el (ivy-configure): Add :display-transformer-fn, Oleh Krehel, 2019/10/16
- [elpa] master 9da8003 158/184: counsel.el (counsel-M-x): Don't sort by default, Oleh Krehel, 2019/10/16
- [elpa] master 8f08f38 155/184: counsel.el (counsel--grep-last-pos): Refactor from counsel-grep-last-line, Oleh Krehel, 2019/10/16
- [elpa] master 6b40d40 156/184: ivy.el (ivy--occur-press-update-window): Re-use ivy-highlight-grep-commands, Oleh Krehel, 2019/10/16
- [elpa] master 2ed4416 165/184: ivy.el (ivy-configure): Add :exit-codes, Oleh Krehel, 2019/10/16
- [elpa] master 2ce5450 177/184: counsel.el (counsel-find-file): Bind "M-o R" to find-file-read-only, Oleh Krehel, 2019/10/16
- [elpa] master c82b852 174/184: ivy.el (ivy-occur-revert-buffer): Simplify,
Oleh Krehel <=
- [elpa] master 8bc23e6 104/184: counsel.el (counsel-compile): delete duplicates, Oleh Krehel, 2019/10/16
- [elpa] master 966525c 118/184: counsel.el (counsel-cd): Fix for counsel-ag, Oleh Krehel, 2019/10/16
- [elpa] master f628569 127/184: Make ivy--magic-file-slash less aggressive, Oleh Krehel, 2019/10/16
- [elpa] master efdee7a 172/184: swiper.el (swiper--occur-insert-lines): Extract, Oleh Krehel, 2019/10/16