]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy.el (ivy-occur): Give full counsel-git-grep cands
authorOleh Krehel <ohwoeowho@gmail.com>
Wed, 11 Nov 2015 15:21:02 +0000 (16:21 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Wed, 11 Nov 2015 15:21:02 +0000 (16:21 +0100)
This means that the " | head -n 200" speed-up isn't used and full
candidates are returned.

ivy.el

diff --git a/ivy.el b/ivy.el
index a486f2b863d3c7f3487bc380f96737104c5b8221..eecff0054c64a4110fc4143f3e218e56251556ed 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -2188,7 +2188,14 @@ It's possible to have an unlimited amount of *ivy-occur* buffers."
         (do-grep (eq (ivy-state-caller ivy-last) 'counsel-git-grep)))
     (with-current-buffer buffer
       (if do-grep
-          (ivy-occur-grep-mode)
+          (progn
+            (setq ivy--old-cands
+                  (split-string
+                   (shell-command-to-string
+                    (format counsel-git-grep-cmd ivy--old-re))
+                   "\n"
+                   t))
+            (ivy-occur-grep-mode))
         (ivy-occur-mode))
       (setf (ivy-state-text ivy-last) ivy-text)
       (setq ivy-occur-last ivy-last)