[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ef3f010 128/348: ivy.el (ivy--insert-prompt): Improve the
From: |
Oleh Krehel |
Subject: |
[elpa] master ef3f010 128/348: ivy.el (ivy--insert-prompt): Improve the extra "\n" logic |
Date: |
Sat, 8 Apr 2017 11:03:41 -0400 (EDT) |
branch: master
commit ef3f010cd2d3504263f6364a0c7aef896c190e6a
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy--insert-prompt): Improve the extra "\n" logic
* ivy.el (ivy--insert-prompt): Update.
---
ivy.el | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/ivy.el b/ivy.el
index 8034739..aa32186 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2044,11 +2044,16 @@ The returned value should be the updated PROMPT.")
(save-excursion
(goto-char (point-min))
(delete-region (point-min) (minibuffer-prompt-end))
- (if (> (+ (mod (+ (length n-str) (length d-str)) (window-width))
- (length ivy-text))
- (window-width))
- (setq n-str (concat n-str "\n" d-str))
- (setq n-str (concat n-str d-str)))
+ (let ((len-n (length n-str))
+ (len-d (length d-str))
+ (ww (window-width)))
+ (setq n-str
+ (cond ((> (+ len-n len-d) ww)
+ (concat n-str "\n" d-str "\n"))
+ ((> (+ len-n len-d (length ivy-text)) ww)
+ (concat n-str d-str "\n"))
+ (t
+ (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))))
- [elpa] master 718a06b 345/348: doc/Changelog.org: Fix links, (continued)
- [elpa] master 718a06b 345/348: doc/Changelog.org: Fix links, Oleh Krehel, 2017/04/08
- [elpa] master 802c9da 271/348: counsel.el: Add counsel-command-history, Oleh Krehel, 2017/04/08
- [elpa] master ee91a25 283/348: ivy.el (ivy--sort-maybe): Fix byte-compiler warning, Oleh Krehel, 2017/04/08
- [elpa] master dc693c3 280/348: Make ivy--flx-sort more intelligent, Oleh Krehel, 2017/04/08
- [elpa] master 182e35e 298/348: Apply search highlighting for evil when applicable, Oleh Krehel, 2017/04/08
- [elpa] master aedea1a 289/348: counsel.el (counsel-package): Add func to manage packages., Oleh Krehel, 2017/04/08
- [elpa] master b9c52be 301/348: counsel.el (counsel-git): Add "x" action, Oleh Krehel, 2017/04/08
- [elpa] master dbeb5b1 303/348: Ensure counsel-M-x preserves last-command, Oleh Krehel, 2017/04/08
- [elpa] master ae3ca26 117/348: counsel.el (counsel-locate-action-extern): Add w32 support, Oleh Krehel, 2017/04/08
- [elpa] master 3e651a3 116/348: Make swiper-all use point positions instead of line positions, Oleh Krehel, 2017/04/08
- [elpa] master ef3f010 128/348: ivy.el (ivy--insert-prompt): Improve the extra "\n" logic,
Oleh Krehel <=
- [elpa] master 870112e 176/348: counsel.el (counsel-ag-function): Use sync on remote, Oleh Krehel, 2017/04/08
- [elpa] master 1914ecd 203/348: counsel.el (counsel-recoll-function): Add shell-quote-argument, Oleh Krehel, 2017/04/08
- [elpa] master f0e49d5 213/348: Improve recursive minibuffers with two emacsclients, Oleh Krehel, 2017/04/08
- [elpa] master df9ad89 220/348: counsel.el (counsel-rpm): New command, Oleh Krehel, 2017/04/08
- [elpa] master aea4919 225/348: Shrink ivy back to ivy-height after dispatching actions., Oleh Krehel, 2017/04/08
- [elpa] master 88bf299 228/348: counsel.el (counsel-recentf): Remove properties from recentf-list, Oleh Krehel, 2017/04/08
- [elpa] master 576a1e3 232/348: Revert "ivy.el (ivy-call): setq default-directory instead of let", Oleh Krehel, 2017/04/08
- [elpa] master 50bb6b3 250/348: ivy.el (ivy-call): Call the action in ivy-state-buffer, Oleh Krehel, 2017/04/08
- [elpa] master f9f2c8c 251/348: counsel.el (counsel-bookmark-avoid-dired): Add, Oleh Krehel, 2017/04/08
- [elpa] master 123f9e1 258/348: swiper-all should consider magit stash buffers too, Oleh Krehel, 2017/04/08