branch: master
commit f3a737d561e7217acdab2f856bf3a01db3192988
Author: Basil L. Contovounesios <[email protected]>
Commit: Oleh Krehel <[email protected]>

    counsel.el (counsel-git-grep-transformer): Optimise text props
    
    add-face-text-property is both more flexible and slightly more
    performant than set-text-properties on the author's machine.
    
    Fixes #1264
---
 counsel.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/counsel.el b/counsel.el
index cfb87e0..2a87113 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1166,14 +1166,14 @@ Typical value: '(recenter)."
 (defun counsel-git-grep-transformer (str)
   "Higlight file and line number in STR."
   (when (string-match "\\`\\([^:]+\\):\\([^:]+\\):" str)
-    (set-text-properties (match-beginning 1)
-                         (match-end 1)
-                         '(face compilation-info)
-                         str)
-    (set-text-properties (match-beginning 2)
-                         (match-end 2)
-                         '(face compilation-line-number)
-                         str))
+    (add-face-text-property (match-beginning 1)
+                            (match-end 1)
+                            'compilation-info
+                            nil str)
+    (add-face-text-property (match-beginning 2)
+                            (match-end 2)
+                            'compilation-line-number
+                            nil str))
   str)
 
 (defvar counsel-git-grep-projects-alist nil

Reply via email to