Skip to content

Commit 6605995

Browse files
committed
counsel--grep-mode-occur: remove column indicators for wgrep.
Fix abo-abo#1800.
1 parent 86635fb commit 6605995

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

counsel.el

+8-1
Original file line numberDiff line numberDiff line change
@@ -2466,7 +2466,14 @@ It applies no filtering to ivy--all-candidates."
24662466
(insert (format "-*- mode:grep; default-directory: %S -*-\n\n\n" default-directory))
24672467
(insert (format "%d candidates:\n" (length ivy--all-candidates)))
24682468
(ivy--occur-insert-lines
2469-
(mapcar (lambda (cand) (concat "./" prepend cand)) ivy--all-candidates))))
2469+
(mapcar (lambda (cand)
2470+
(save-match-data
2471+
(if (string-match
2472+
;; Remove column indicators if present
2473+
"\\(?1:[^\n:]+?[^\n/:]\\):[\t ]*\\(?3:[1-9][0-9]*\\)[\t ]*:\\(?3:[1-9][0-9]*:\\)" cand)
2474+
(replace-match "" nil nil cand 3)
2475+
cand)
2476+
(concat "./" prepend cand))) ivy--all-candidates))))
24702477

24712478
;;** `counsel-ag'
24722479
(defvar counsel-ag-map

0 commit comments

Comments
 (0)