]> code.delx.au - gnu-emacs-elpa/blobdiff - ivy.el
Don't highlight that match in the file name part
[gnu-emacs-elpa] / ivy.el
diff --git a/ivy.el b/ivy.el
index 7d705c8af753dcb15adee502c2b814c4591c32df..8e12408f300ce6224cdd4002179dc277cd5626b7 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1963,7 +1963,10 @@ depending on the number of candidates."
                   (= ivy--length 1)
                   (not (string= ivy-text "/")))
               (let ((default-directory ivy--directory))
-                (file-directory-p ivy--current)))
+                (and
+                 (not (equal ivy--current ""))
+                 (file-directory-p ivy--current)
+                 (file-exists-p ivy--current))))
          (ivy--cd (expand-file-name ivy--current ivy--directory)))))
 
 (defun ivy--exhibit ()
@@ -2435,7 +2438,11 @@ SEPARATOR is used to join the candidates."
      start end 'face face str)))
 
 (defun ivy--format-minibuffer-line (str)
-  (let ((start 0)
+  (let ((start
+         (if (and (memq (ivy-state-caller ivy-last) '(counsel-git-grep))
+                  (string-match "^[^:]+:[^:]+:" str))
+             (match-end 0)
+           0))
         (str (copy-sequence str)))
     (cond ((eq ivy--regex-function 'ivy--regex-ignore-order)
            (when (consp ivy--old-re)