]> code.delx.au - gnu-emacs-elpa/commitdiff
counsel.el (counsel-git-grep-occur): Fix greedy-nongreedy bug
authorOleh Krehel <ohwoeowho@gmail.com>
Sat, 27 Feb 2016 08:12:02 +0000 (09:12 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Sat, 27 Feb 2016 08:13:13 +0000 (09:13 +0100)
The regex has to be greedy for the shell command to succeed.

counsel.el

index e8597a6f8fb90354d7c61050ce13061a5b728024..dfe6d94a8c808612e7590ceb56c8645dd4487dd4 100644 (file)
@@ -885,9 +885,7 @@ When NO-ASYNC is non-nil, do it synchronously."
   (let ((cands (split-string
                 (shell-command-to-string
                  (format counsel-git-grep-cmd
-                         (if (stringp ivy--old-re)
-                             ivy--old-re
-                           (caar ivy--old-re))))
+                         (setq ivy--old-re (ivy--regex ivy-text t))))
                 "\n"
                 t)))
     ;; Need precise number of header lines for `wgrep' to work.