branch: master
commit 824f8d767094ad48c047c811cbe764a0de96892c
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
counsel.el (counsel--find-return-list): Works with or without "./" prefix
Fixes #2196
---
counsel.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/counsel.el b/counsel.el
index 0885322..6314d51 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2605,12 +2605,13 @@ FZF-PROMPT, if non-nil, is passed as `ivy-read' prompt
argument."
(counsel--call
(cons find-program args)
(lambda ()
- (goto-char (point-min))
(let (files)
+ (goto-char (point-min))
(while (< (point) (point-max))
- (push (buffer-substring
- (+ 2 (line-beginning-position)) (line-end-position)) files)
- (forward-line 1))
+ (when (looking-at "\\./")
+ (goto-char (match-end 0)))
+ (push (buffer-substring (point) (line-end-position)) files)
+ (beginning-of-line 2))
(nreverse files)))))
(defcustom counsel-file-jump-args (split-string ". -name .git -prune -o -type
f -print")