branch: master commit 87da3a2eb1984ca62d4adb912ea56d279be80f05 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
counsel.el (counsel-async-split-string-re): New defvar * counsel.el (counsel--async-sentinel): (counsel--async-filter): Use `counsel-async-split-string-re'. --- counsel.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/counsel.el b/counsel.el index a177717..c531367 100644 --- a/counsel.el +++ b/counsel.el @@ -66,6 +66,9 @@ "Store the time when a new process was started. Or the time of the last minibuffer update.") +(defvar counsel-async-split-string-re "\n" + "Store the regexp for splitting shell command output.") + (defun counsel--async-command (cmd &optional process-sentinel process-filter) (let* ((counsel--process " *counsel*") (proc (get-process counsel--process)) @@ -88,7 +91,10 @@ Or the time of the last minibuffer update.") (with-current-buffer (process-buffer process) (ivy--set-candidates (ivy--sort-maybe - (split-string (buffer-string) "\n" t))) + (split-string + (buffer-string) + counsel-async-split-string-re + t))) (if (null ivy--old-cands) (setq ivy--index (or (ivy--preselect-index @@ -125,7 +131,10 @@ Update the minibuffer with the amount of lines collected every (goto-char (point-min)) (setq size (- (buffer-size) (forward-line (buffer-size)))) (ivy--set-candidates - (split-string (buffer-string) "\n" t))) + (split-string + (buffer-string) + counsel-async-split-string-re + t))) (let ((ivy--prompt (format (concat "%d++ " (ivy-state-prompt ivy-last)) size)))