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

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

[elpa] master a2af29b 271/399: ivy.el (ivy--occur-insert-lines): Fix mis


From: Oleh Krehel
Subject: [elpa] master a2af29b 271/399: ivy.el (ivy--occur-insert-lines): Fix missing line numbers
Date: Sat, 20 Jul 2019 14:57:38 -0400 (EDT)

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

    ivy.el (ivy--occur-insert-lines): Fix missing line numbers
    
    Fixes #2076
---
 ivy.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/ivy.el b/ivy.el
index f739b1f..f3645dd 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4381,12 +4381,14 @@ When `ivy-calling' isn't nil, call `ivy-occur-press'."
   "Insert CANDS into `ivy-occur' buffer."
   (font-lock-mode -1)
   (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)))))
+    (setq cand
+          (if (string-match "\\`\\(.*:[0-9]+:\\)\\(.*\\)\\'" cand)
+              (let ((file-and-line (match-string 1 cand))
+                    (grep-line (match-string 2 cand)))
+                (concat
+                 (propertize file-and-line 'face 'ivy-grep-info)
+                 (ivy--highlight-fuzzy grep-line)))
+            (ivy--highlight-fuzzy cands)))
     (add-text-properties
      0 (length cand)
      '(mouse-face



reply via email to

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