Skip to content

Commit

Permalink
ivy.el (ivy--occur-insert-lines): Don't highlight the file name part
Browse files Browse the repository at this point in the history
  • Loading branch information
abo-abo authored and astoff committed Jan 1, 2021
1 parent e7c2fe7 commit ab5cd39
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ivy.el
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ab5cd39

Please sign in to comment.