[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-posframe ba1bc4f 092/195: Update prompt in dynamic
From: |
Feng Shu |
Subject: |
[elpa] externals/ivy-posframe ba1bc4f 092/195: Update prompt in dynamic collections |
Date: |
Sat, 3 Oct 2020 07:11:51 -0400 (EDT) |
branch: externals/ivy-posframe
commit ba1bc4f97448ecee178267184772c0ff3e4c511a
Author: Troy Hinckley <t.macman@gmail.com>
Commit: Troy Hinckley <t.macman@gmail.com>
Update prompt in dynamic collections
---
ivy-posframe.el | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/ivy-posframe.el b/ivy-posframe.el
index be8444a..27bb838 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -205,14 +205,7 @@ This variable is useful for `ivy-posframe-read-action' .")
(posframe-show
ivy-posframe-buffer
:font ivy-posframe-font
- :string
- (with-current-buffer (window-buffer (active-minibuffer-window))
- (let ((point (point))
- (string (if ivy-posframe--ignore-prompt
- str
- (concat (buffer-string) " " str))))
- (add-text-properties (- point 1) point '(face ivy-posframe-cursor)
string)
- string))
+ :string str
:position (point)
:poshandler poshandler
:background-color (face-attribute 'ivy-posframe :background nil t)
@@ -223,7 +216,8 @@ This variable is useful for `ivy-posframe-read-action' .")
:min-width (or ivy-posframe-min-width (round (* (frame-width) 0.62)))
:internal-border-width ivy-posframe-border-width
:internal-border-color (face-attribute 'ivy-posframe-border :background
nil t)
- :override-parameters ivy-posframe-parameters))))
+ :override-parameters ivy-posframe-parameters))
+ (ivy-posframe--add-prompt)))
(defun ivy-posframe-display (str)
(let ((func (intern (format "ivy-posframe-display-at-%s"
@@ -265,6 +259,19 @@ This variable is useful for `ivy-posframe-read-action' .")
(when (ivy-posframe-read-action)
(ivy-done)))
+(defun ivy-posframe--add-prompt ()
+ "Add the ivy prompt to the posframe."
+ (unless ivy-posframe--ignore-prompt
+ (with-current-buffer (window-buffer (active-minibuffer-window))
+ (let ((point (point))
+ (prompt (buffer-string)))
+ (remove-text-properties 0 (length prompt) '(read-only nil) prompt)
+ (with-current-buffer ivy-posframe-buffer
+ (goto-char (point-min))
+ (kill-line 1)
+ (insert prompt " \n")
+ (add-text-properties point (1+ point) '(face
ivy-posframe-cursor)))))))
+
(defun ivy-posframe-read-action ()
"Change the action to one of the available ones.
@@ -441,6 +448,7 @@ selection, non-nil otherwise."
(define-key ivy-minibuffer-map [remap ivy-avy] 'ivy-posframe-avy)
(define-key ivy-minibuffer-map [remap swiper-avy] 'ivy-posframe-swiper-avy)
(advice-add 'ivy--minibuffer-setup :around #'ivy-posframe--minibuffer-setup)
+ (advice-add 'ivy--queue-exhibit :after #'ivy-posframe--add-prompt)
(message "ivy-posframe is enabled, disabling it need to reboot emacs."))
;;;###autoload
- [elpa] externals/ivy-posframe 83657be 114/195: add display-functions-alist to restore ivy variable, (continued)
- [elpa] externals/ivy-posframe 83657be 114/195: add display-functions-alist to restore ivy variable, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 27e3cec 176/195: Try to fix Minibuffer is hiding always #66, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe c43acf3 132/195: alias ivy-posframe-enable as ivy-posframe-mode, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 3c3740e 142/195: Add ivy-posframe-lighter, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 6d697ff 190/195: Try to fix: Posframe max-width? #82, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe ae9bafe 191/195: (defvar avy-pre-action), Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 4242977 079/195: Remove #' (function quote) of `lambda`, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 0a870c1 080/195: Remove top-level ivy-posframe setup function executing, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 38aff80 084/195: Add ivy-posframe-demo, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 13180ce 087/195: Merge pull request #35 from conao3/fix-minibuffer-issue, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe ba1bc4f 092/195: Update prompt in dynamic collections,
Feng Shu <=
- [elpa] externals/ivy-posframe 233a3ec 070/195: Fix Strange behaviour #25, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 1297ebc 078/195: Fix focus can go out of frame with multi line collections #31, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 9e01129 083/195: Remove ivy-posframe-setup, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe b1ecab7 096/195: Merge pull request #42 from tttuuu888/work, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 0a8cb5a 101/195: fix advice function style, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 441c1bf 150/195: Fix First line disappears with the specific condition. #47, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe dddbd8b 139/195: Remove ivy-posframe-display-function-list, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe b6afaf7 129/195: generate, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 19cc919 110/195: use function-alist instead of display-functions, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe ca2b6db 106/195: add disable mode code, Feng Shu, 2020/10/03