[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 87da3a2 132/272: counsel.el (counsel-async-split-string-re

From: Oleh Krehel
Subject: [elpa] master 87da3a2 132/272: counsel.el (counsel-async-split-string-re): New defvar
Date: Mon, 25 Apr 2016 10:13:21 +0000

branch: master
commit 87da3a2eb1984ca62d4adb912ea56d279be80f05
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    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)
-            (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 
         (goto-char (point-min))
         (setq size (- (buffer-size) (forward-line (buffer-size))))
-         (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))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]