branch: externals/ivy-posframe commit 0989e424a2d271fba030eb22f8787dd7adb9dcb1 Author: Feng Shu <tuma...@163.com> Commit: Feng Shu <tuma...@163.com>
Show cursor's position, fix #9 --- ivy-posframe.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ivy-posframe.el b/ivy-posframe.el index 1067384..d7b30d0 100644 --- a/ivy-posframe.el +++ b/ivy-posframe.el @@ -127,6 +127,11 @@ When nil, Using current frame's font as fallback." "Face used by the ivy-posframe." :group 'ivy-posframe) +(defface ivy-posframe-cursor + '((t (:inherit default :background "#ffff00"))) + "Face used by the ivy-posframe's fake cursor." + :group 'ivy-posframe) + (defvar ivy-posframe-buffer " *ivy-posframe-buffer*" "The posframe-buffer used by ivy-posframe.") @@ -146,10 +151,13 @@ This variable is useful for `ivy-posframe-read-action' .") ivy-posframe-buffer :font ivy-posframe-font :string - (if ivy-posframe--ignore-prompt - str - (with-current-buffer (get-buffer-create " *Minibuf-1*") - (concat (buffer-string) " " str))) + (with-current-buffer (get-buffer-create " *Minibuf-1*") + (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)) :position (point) :poshandler poshandler :background-color (face-attribute 'ivy-posframe :background)