From 6fc36b5aa72d8f2e1ec4727c6bbd498168a31732 Mon Sep 17 00:00:00 2001 From: Eric Danan Date: Tue, 29 Mar 2016 11:58:57 +0200 Subject: [PATCH] option to add newline after ivy-read prompt --- ivy.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ivy.el b/ivy.el index f11543a96..bd5e27625 100644 --- 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)))) -- 2.39.2