emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 226171b 268/399: ivy.el (ivy--occur-insert-lines): Don't h


From: Oleh Krehel
Subject: [elpa] master 226171b 268/399: ivy.el (ivy--occur-insert-lines): Don't highlight the file name part
Date: Sat, 20 Jul 2019 14:57:37 -0400 (EDT)

branch: master
commit 226171b27ff4531cb30d47918162cb0d06619e19
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy--occur-insert-lines): Don't highlight the file name part
    
    Fixes #2073
---
 ivy.el | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/ivy.el b/ivy.el
index 8adafd2..f739b1f 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4380,21 +4380,21 @@ When `ivy-calling' isn't nil, call `ivy-occur-press'."
 (defun ivy--occur-insert-lines (cands)
   "Insert CANDS into `ivy-occur' buffer."
   (font-lock-mode -1)
-  (dolist (str cands)
-    (setq str (ivy--highlight-fuzzy (copy-sequence str)))
+  (dolist (cand cands)
+    (let ((parts (split-string cand ":[[:digit:]]+:")))
+      (setq cand
+            (if (= 2 (length parts))
+                (concat (propertize (nth 0 parts) 'face 'ivy-grep-info)
+                        (ivy--highlight-fuzzy (nth 1 parts)))
+              (ivy--highlight-fuzzy (nth 0 parts)))))
     (add-text-properties
-     0 (length str)
+     0 (length cand)
      '(mouse-face
        highlight
        help-echo "mouse-1: call ivy-action")
-     str)
-    (insert (if (string-match-p "\\`.[/\\]" str) "" "    ")
-            str ?\n))
-  (goto-char (point-min))
-  (forward-line 4)
-  (while (re-search-forward "^.*:[[:digit:]]+:" nil t)
-    (ivy-add-face-text-property
-     (match-beginning 0) (match-end 0) 'ivy-grep-info nil t)))
+     cand)
+    (insert (if (string-match-p "\\`.[/\\]" cand) "" "    ")
+            cand ?\n)))
 
 (defun ivy-occur ()
   "Stop completion and put the current candidates into a new buffer.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]