]> code.delx.au - gnu-emacs-elpa/commitdiff
option to add newline after ivy-read prompt
authorEric Danan <admin@ericdanan.net>
Tue, 29 Mar 2016 09:58:57 +0000 (11:58 +0200)
committerEric Danan <admin@ericdanan.net>
Tue, 29 Mar 2016 09:58:57 +0000 (11:58 +0200)
ivy.el

diff --git a/ivy.el b/ivy.el
index f11543a96e337e5868200d78e62dd002d1e993c4..bd5e276254a3284f94c74652ec09552b6cfc5a73 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -124,6 +124,10 @@ Set this to \"(%d/%d) \" to display both the index and the count."
           (const :tag "Count matches and show current match" "(%d/%d) ")
           string))
 
+(defcustom ivy-add-newline-after-prompt nil
+  "When non-nil, add a newline after the `ivy-read' prompt."
+  :type 'boolean)
+
 (defcustom ivy-wrap nil
   "When non-nil, wrap around after the first and the last candidate."
   :type 'boolean)
@@ -1856,6 +1860,8 @@ depending on the number of candidates."
                  (window-width))
               (setq n-str (concat n-str "\n" d-str))
             (setq n-str (concat n-str d-str)))
+          (when ivy-add-newline-after-prompt
+            (setq n-str (concat n-str "\n")))
           (let ((regex (format "\\([^\n]\\{%d\\}\\)[^\n]" (window-width))))
             (while (string-match regex n-str)
               (setq n-str (replace-match (concat (match-string 1 n-str) "\n") nil t n-str 1))))