[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6a5a688 201/272: counsel.el: Improve counsel-grep
From: |
Oleh Krehel |
Subject: |
[elpa] master 6a5a688 201/272: counsel.el: Improve counsel-grep |
Date: |
Mon, 25 Apr 2016 10:13:25 +0000 |
branch: master
commit 6a5a688ff0f121067f07a038cdbbe48331e9498c
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el: Improve counsel-grep
---
counsel.el | 38 +++++++++++++++++++++++---------------
1 file changed, 23 insertions(+), 15 deletions(-)
diff --git a/counsel.el b/counsel.el
index 6afdbbc..59926e3 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1371,6 +1371,8 @@ This uses `counsel-ag' with `counsel-pt-base-command'
replacing
(re-search-forward (ivy--regex ivy-text t) (line-end-position) t)
(unless (eq ivy-exit 'done)
(swiper--cleanup)
+ (isearch-range-invisible (line-beginning-position)
+ (line-end-position))
(swiper--add-overlays (ivy--regex ivy-text)))))))
;;;###autoload
@@ -1378,21 +1380,27 @@ This uses `counsel-ag' with `counsel-pt-base-command'
replacing
"Grep for a string in the current file."
(interactive)
(setq counsel--git-grep-dir (buffer-file-name))
- (ivy-read "grep: " 'counsel-grep-function
- :dynamic-collection t
- :preselect (format "%d:%s"
- (line-number-at-pos)
- (buffer-substring-no-properties
- (line-beginning-position)
- (line-end-position)))
- :history 'counsel-git-grep-history
- :update-fn (lambda ()
- (counsel-grep-action ivy--current))
- :action #'counsel-grep-action
- :unwind (lambda ()
- (counsel-delete-process)
- (swiper--cleanup))
- :caller 'counsel-grep))
+ (let ((init-point (point))
+ res)
+ (unwind-protect
+ (setq res (ivy-read "grep: " 'counsel-grep-function
+ :dynamic-collection t
+ :preselect (format "%d:%s"
+ (line-number-at-pos)
+ (buffer-substring-no-properties
+ (line-beginning-position)
+ (line-end-position)))
+ :history 'counsel-git-grep-history
+ :update-fn (lambda ()
+ (counsel-grep-action ivy--current))
+ :action #'counsel-grep-action
+ :unwind (lambda ()
+ (counsel-delete-process)
+ (swiper--cleanup))
+ :caller 'counsel-grep))
+ (unless res
+ (goto-char init-point)))))
+
;;** `counsel-recoll'
(defun counsel-recoll-function (string)
"Grep in the current directory for STRING."
- [elpa] master f7c7114 037/272: ivy-test.el (ivy--regex-ignore-order): New test, (continued)
- [elpa] master f7c7114 037/272: ivy-test.el (ivy--regex-ignore-order): New test, Oleh Krehel, 2016/04/25
- [elpa] master 1088078 266/272: When selecting a non-existing key in an alist, return that key, Oleh Krehel, 2016/04/25
- [elpa] master 341b5a2 229/272: counsel-grep should pick candidates closest to point, Oleh Krehel, 2016/04/25
- [elpa] master d71b5c5 081/272: swiper.el (swiper--action): Update regexp-search-ring, Oleh Krehel, 2016/04/25
- [elpa] master e1c156b 074/272: ivy.el (ivy--resize-minibuffer-to-fit): Check frame-root-window-p, Oleh Krehel, 2016/04/25
- [elpa] master ebd3e29 089/272: swiper.el (swiper--update-input-ivy): Fix a bug, Oleh Krehel, 2016/04/25
- [elpa] master de0e541 234/272: Speed up counsel-grep by up to 40 times, Oleh Krehel, 2016/04/25
- [elpa] master 299bc13 097/272: Fix initial-input not set to nil for 'read-file-name-internal, Oleh Krehel, 2016/04/25
- [elpa] master bab5aab 269/272: doc/Changelog.org: Prepare for the 0.8.0 release, Oleh Krehel, 2016/04/25
- [elpa] master 0efbf6e 055/272: Simplify the signature for :dynamic-collection functions, Oleh Krehel, 2016/04/25
- [elpa] master 6a5a688 201/272: counsel.el: Improve counsel-grep,
Oleh Krehel <=
- [elpa] master 65cf724 247/272: Make ivy--regex work with "[^ ]", Oleh Krehel, 2016/04/25
- [elpa] master f72cea2 253/272: swiper.el (swiper-mc): Restore interactive, Oleh Krehel, 2016/04/25
- [elpa] master 08d5578 137/272: counsel.el (counsel-git-log): New command, Oleh Krehel, 2016/04/25
- [elpa] master 00f08f7 073/272: Improve Ivy documentation UI, Oleh Krehel, 2016/04/25
- [elpa] master 8f527d7 149/272: ivy.el (ivy-next-history-element): No "\\_<" for dynamic-collection, Oleh Krehel, 2016/04/25
- [elpa] master 265bf49 251/272: counsel.el: Fix compile warning, Oleh Krehel, 2016/04/25
- [elpa] master 7cf13a7 186/272: counsel.el (counsel-linux-app): New command, Oleh Krehel, 2016/04/25
- [elpa] master 31a2f86 238/272: counsel.el (counsel-expression-history): enable-recursive-minibuffers, Oleh Krehel, 2016/04/25
- [elpa] master 5299c0a 099/272: doc/ivy.texi: Re-export from previous commit, Oleh Krehel, 2016/04/25
- [elpa] master a50f668 111/272: counsel.el (counsel-locate-options): Make obsolete, Oleh Krehel, 2016/04/25