Skip to content

Commit

Permalink
counsel--grep-mode-occur: remove column indicators for wgrep.
Browse files Browse the repository at this point in the history
  • Loading branch information
mookid committed Dec 2, 2018
1 parent 86635fb commit 31a328a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion counsel.el
Original file line number Diff line number Diff line change
Expand Up @@ -2466,7 +2466,14 @@ It applies no filtering to ivy--all-candidates."
(insert (format "-*- mode:grep; default-directory: %S -*-\n\n\n" default-directory))
(insert (format "%d candidates:\n" (length ivy--all-candidates)))
(ivy--occur-insert-lines
(mapcar (lambda (cand) (concat "./" prepend cand)) ivy--all-candidates))))
(mapcar (lambda (cand)
(save-match-data
(if (string-match
;; Remove column indicators if present
"\\(?1:[^\n:]+?[^\n/:]\\):[\t ]*\\(?3:[1-9][0-9]*\\)[\t ]*:\\(?3:[1-9][0-9]*:\\)" cand)
(replace-match "" nil nil cand 3)
cand)
(concat "./" prepend cand))) ivy--all-candidates))))

;;** `counsel-ag'
(defvar counsel-ag-map
Expand Down

0 comments on commit 31a328a

Please sign in to comment.