[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 615dd90 241/272: counsel.el (counsel-grep-action): Work be
From: |
Oleh Krehel |
Subject: |
[elpa] master 615dd90 241/272: counsel.el (counsel-grep-action): Work better from ivy-occur |
Date: |
Mon, 25 Apr 2016 10:13:28 +0000 |
branch: master
commit 615dd90094131cc95fe2d5851864ca0a5531bcfc
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-grep-action): Work better from ivy-occur
---
counsel.el | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/counsel.el b/counsel.el
index b5506a0..4620c1e 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1414,19 +1414,24 @@ the command."
(defun counsel-grep-action (x)
(with-ivy-window
(swiper--cleanup)
- (when (string-match "\\`\\([0-9]+\\):\\(.*\\)\\'" x)
- (let ((file-name counsel--git-grep-dir)
- (line-number (match-string-no-properties 1 x)))
+ (let ((default-directory (file-name-directory counsel--git-grep-dir))
+ file-name line-number)
+ (when (cond ((string-match "\\`\\([0-9]+\\):\\(.*\\)\\'" x)
+ (setq file-name counsel--git-grep-dir)
+ (setq line-number (match-string-no-properties 1 x)))
+ ((string-match "\\`\\([^:]+\\):\\([0-9]+\\):\\(.*\\)\\'" x)
+ (setq file-name (match-string-no-properties 1 x))
+ (setq line-number (match-string-no-properties 2 x)))
+ (t nil))
(find-file file-name)
(goto-char (point-min))
(forward-line (1- (string-to-number line-number)))
(re-search-forward (ivy--regex ivy-text t) (line-end-position) t)
(if (eq ivy-exit 'done)
(swiper--ensure-visible)
- (unless (eq ivy-exit 'done)
- (isearch-range-invisible (line-beginning-position)
- (line-end-position))
- (swiper--add-overlays (ivy--regex ivy-text))))))))
+ (isearch-range-invisible (line-beginning-position)
+ (line-end-position))
+ (swiper--add-overlays (ivy--regex ivy-text)))))))
(defun counsel-grep-occur ()
"Generate a custom occur buffer for `counsel-grep'."
- [elpa] master bf7d95f 143/272: Move read-file-name to :display-transformer-fn, (continued)
- [elpa] master bf7d95f 143/272: Move read-file-name to :display-transformer-fn, Oleh Krehel, 2016/04/25
- [elpa] master 80825a6 082/272: ivy.el: Fixup face docs, Oleh Krehel, 2016/04/25
- [elpa] master 44856a3 219/272: ivy.el (ivy-read): Revert abf880f, Oleh Krehel, 2016/04/25
- [elpa] master 0afb000 077/272: Fix default-directory for ivy-occur + counsel-git-grep, Oleh Krehel, 2016/04/25
- [elpa] master a6cd189 192/272: counsel.el (counsel-linux-apps-list): Skip spaces around =, Oleh Krehel, 2016/04/25
- [elpa] master e8f516e 182/272: counsel.el (counsel-ag): Add transformer, Oleh Krehel, 2016/04/25
- [elpa] master 6a8da39 206/272: counsel.el (counsel-grep-action): Reveal outlines, Oleh Krehel, 2016/04/25
- [elpa] master 2bd092d 222/272: ivy.el (ivy--minibuffer-setup): Ensure inhibit-field-text-motion is nil, Oleh Krehel, 2016/04/25
- [elpa] master 2ac1d2d 256/272: ivy.el (ivy-occur-press): Set counsel-grep-last-line to nil, Oleh Krehel, 2016/04/25
- [elpa] master 4ebf0b4 215/272: ivy.el: Add `counsel-find-file' transformer., Oleh Krehel, 2016/04/25
- [elpa] master 615dd90 241/272: counsel.el (counsel-grep-action): Work better from ivy-occur,
Oleh Krehel <=
- [elpa] master 1485e58 076/272: Add ignore pattern toggling, Oleh Krehel, 2016/04/25
- [elpa] master 8dfff3e 200/272: ivy.el (ivy-next-history-element): Improve, Oleh Krehel, 2016/04/25
- [elpa] master 3177419 216/272: ivy.el (ivy-sort-functions-alist): Update :type, Oleh Krehel, 2016/04/25
- [elpa] master abf880f 214/272: ivy.el (ivy-read): Make "M-o" not modify the action, Oleh Krehel, 2016/04/25
- [elpa] master 3f4f080 226/272: counsel-ag now works with ivy-occur-revert-buffer, Oleh Krehel, 2016/04/25
- [elpa] master f31ab12 066/272: swiper.el (swiper--ivy): Return point, Oleh Krehel, 2016/04/25
- [elpa] master 6777cf8 220/272: counsel.el (counsel-unquote-regex-parens): Improve, Oleh Krehel, 2016/04/25
- [elpa] master ddc1d9f 114/272: Move all faces to ivy-faces group, Oleh Krehel, 2016/04/25
- [elpa] master e92d282 195/272: Make ivy-ignore-buffers similar to ido-ignore-buffers., Oleh Krehel, 2016/04/25
- [elpa] master 4235ffc 092/272: colir.el (colir-blend-face-background): Improve, Oleh Krehel, 2016/04/25