[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f8d78eb 197/348: Add a fake cursor to inline completion di
From: |
Oleh Krehel |
Subject: |
[elpa] master f8d78eb 197/348: Add a fake cursor to inline completion display |
Date: |
Sat, 8 Apr 2017 11:03:55 -0400 (EDT) |
branch: master
commit f8d78eb07197b6543d81a0bbed4b05fdf5329848
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Add a fake cursor to inline completion display
* ivy-overlay.el (ivy-cursor): New face.
(ivy-display-function-overlay): Propertize the string with `ivy-cursor'.
---
ivy-overlay.el | 37 ++++++++++++++++++++++++-------------
1 file changed, 24 insertions(+), 13 deletions(-)
diff --git a/ivy-overlay.el b/ivy-overlay.el
index e74e486..8ed753b 100644
--- a/ivy-overlay.el
+++ b/ivy-overlay.el
@@ -25,6 +25,12 @@
;; minibuffer.
;;; Code:
+(defface ivy-cursor
+ '((t (:background "black"
+ :foreground "white")))
+ "Cursor face for inline completion."
+ :group 'ivy-faces)
+
(defvar ivy-overlay-at nil
"Overlay variable for `ivy-display-function-overlay'.")
@@ -61,20 +67,25 @@ Then attach the overlay the character before point."
Hide the minibuffer contents and cursor."
(add-face-text-property (minibuffer-prompt-end) (point-max)
'(:foreground "white"))
- (setq cursor-type nil)
- (with-ivy-window
+ (let ((cursor-pos (1+ (- (point) (minibuffer-prompt-end)))))
(setq cursor-type nil)
- (ivy-overlay-show-after
- (concat
- (buffer-substring (1- (point)) (point))
- ivy-text
- (buffer-substring (point) (line-end-position))
- (ivy-left-pad str
- (+ (if (eq major-mode 'org-mode)
- (* org-indent-indentation-per-level
(org-current-level))
- 0)
- (- ivy-completion-beg ivy-completion-end)
- (current-column)))))))
+ (with-ivy-window
+ (setq cursor-type nil)
+ (let ((overlay-str
+ (concat
+ (buffer-substring (1- (point)) (point))
+ ivy-text
+ (buffer-substring (point) (line-end-position))
+ (ivy-left-pad
+ str
+ (+ (if (eq major-mode 'org-mode)
+ (* org-indent-indentation-per-level (org-current-level))
+ 0)
+ (- ivy-completion-beg ivy-completion-end)
+ (current-column))))))
+ (add-face-text-property cursor-pos (1+ cursor-pos)
+ 'ivy-cursor t overlay-str)
+ (ivy-overlay-show-after overlay-str)))))
(provide 'ivy-overlay)
;;; ivy-overlay.el ends here
- [elpa] master 4c3ecb4 157/348: Restore window position after using swiper., (continued)
- [elpa] master 4c3ecb4 157/348: Restore window position after using swiper., Oleh Krehel, 2017/04/08
- [elpa] master 94f3368 160/348: Extract ivy--flx-propertize from ivy--flx-sort, Oleh Krehel, 2017/04/08
- [elpa] master 6b574e4 173/348: ivy.el (ivy-call): expand-file-name, Oleh Krehel, 2017/04/08
- [elpa] master 93f9321 174/348: ivy.el: Fix byte compiler warnings, Oleh Krehel, 2017/04/08
- [elpa] master 2a9c3f3 191/348: swiper.el (swiper-multi): Don't use virtual buffers, Oleh Krehel, 2017/04/08
- [elpa] master 3a7c8cd 189/348: counsel.el (counsel-recentf): add extra actions, Oleh Krehel, 2017/04/08
- [elpa] master 955585e 190/348: counsel.el (counsel-describe-face): Ensure :preselect string, Oleh Krehel, 2017/04/08
- [elpa] master 3c904fa 192/348: counsel.el (counsel-git-grep-occur): Fix "g", Oleh Krehel, 2017/04/08
- [elpa] master 77ebfdb 196/348: Makefile: load ivy-overlay.el, Oleh Krehel, 2017/04/08
- [elpa] master f357cd2 198/348: ivy-overlay.el (ivy-overlay-cleanup): Restore cursor-type, Oleh Krehel, 2017/04/08
- [elpa] master f8d78eb 197/348: Add a fake cursor to inline completion display,
Oleh Krehel <=
- [elpa] master 1bdc50b 200/348: ivy-overlay.el (ivy-overlay-cleanup): Don't trigger company, Oleh Krehel, 2017/04/08
- [elpa] master bfddbc2 199/348: ivy-overlay.el (ivy-display-function-overlay): Fix up, Oleh Krehel, 2017/04/08
- [elpa] master d1de20f 193/348: Display completion-at-point at point, Oleh Krehel, 2017/04/08
- [elpa] master 8109655 204/348: ivy-overlay.el (ivy-display-function-overlay): Fix with-ivy-window, Oleh Krehel, 2017/04/08
- [elpa] master 572c2aa 206/348: Enable read-only-mode for ivy-occur, Oleh Krehel, 2017/04/08
- [elpa] master 73d23d1 207/348: Correct a minor doc error: `info-describe-symbol' should be `info-lookup-symbol'., Oleh Krehel, 2017/04/08
- [elpa] master 378943c 212/348: ivy.el (ivy--minibuffer-setup): Fixup max-mini-window-height, Oleh Krehel, 2017/04/08
- [elpa] master 8312176 210/348: ivy.el (ivy-magic-tilde): New defcustom, Oleh Krehel, 2017/04/08
- [elpa] master dcec964 211/348: ivy.el (ivy-magic-tilde): Fix type, Oleh Krehel, 2017/04/08
- [elpa] master 3d600b6 214/348: Correct ivy-fixed-height-minibuffer size, Oleh Krehel, 2017/04/08