[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master bb5d0d4 119/399: ivy-overlay.el (ivy-display-function-over
From: |
Oleh Krehel |
Subject: |
[elpa] master bb5d0d4 119/399: ivy-overlay.el (ivy-display-function-overlay): Refactor |
Date: |
Sat, 20 Jul 2019 14:57:04 -0400 (EDT) |
branch: master
commit bb5d0d4e81dffb190ebf94fd34c2d0c9af0f1a6f
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy-overlay.el (ivy-display-function-overlay): Refactor
---
ivy-overlay.el | 55 +++++++++++++++++++++++++++----------------------------
1 file changed, 27 insertions(+), 28 deletions(-)
diff --git a/ivy-overlay.el b/ivy-overlay.el
index 1d4305c..1c10746 100644
--- a/ivy-overlay.el
+++ b/ivy-overlay.el
@@ -109,35 +109,34 @@ Hide the minibuffer contents and cursor."
(insert str)))
(ivy-add-face-text-property (minibuffer-prompt-end) (point-max)
'(:foreground "white"))
- (let ((cursor-pos (1+ (- (point) (minibuffer-prompt-end))))
- (ivy-window (ivy--get-window ivy-last)))
+ (setq cursor-type nil)
+ (with-selected-window (ivy--get-window ivy-last)
+ (when cursor-type
+ (setq ivy--old-cursor-type cursor-type))
(setq cursor-type nil)
- (with-selected-window ivy-window
- (when cursor-type
- (setq ivy--old-cursor-type cursor-type))
- (setq cursor-type nil)
- (let ((overlay-str
- (apply
- #'concat
- (buffer-substring (max (point-min) (1- (point))) (point))
- ivy-text
- (and (eolp) " ")
- (buffer-substring (point) (line-end-position))
- (and (> (length str) 0)
- (list "\n"
- (ivy-left-pad
- (ivy--remove-prefix "\n" str)
- (+ (if (and (eq major-mode 'org-mode)
- (bound-and-true-p org-indent-mode))
- (* org-indent-indentation-per-level
- (org-current-level))
- 0)
- (save-excursion
- (goto-char ivy-completion-beg)
- (current-column)))))))))
- (ivy-add-face-text-property cursor-pos (1+ cursor-pos)
- 'ivy-cursor overlay-str t)
- (ivy-overlay-show-after overlay-str))))))
+ (let ((overlay-str
+ (apply
+ #'concat
+ (buffer-substring (max (point-min) (1- (point))) (point))
+ ivy-text
+ (and (eolp) " ")
+ (buffer-substring (point) (line-end-position))
+ (and (> (length str) 0)
+ (list "\n"
+ (ivy-left-pad
+ (ivy--remove-prefix "\n" str)
+ (+
+ (if (and (eq major-mode 'org-mode)
+ (bound-and-true-p org-indent-mode))
+ (* org-indent-indentation-per-level
(org-current-level))
+ 0)
+ (save-excursion
+ (goto-char ivy-completion-beg)
+ (current-column)))))))))
+ (let ((cursor-offset (1+ (length ivy-text))))
+ (ivy-add-face-text-property cursor-offset (1+ cursor-offset)
+ 'ivy-cursor overlay-str t))
+ (ivy-overlay-show-after overlay-str)))))
(provide 'ivy-overlay)
- [elpa] master c56ad2a 114/399: ivy-hydra.el (ivy-dispatching-done-hydra): Improve, (continued)
- [elpa] master c56ad2a 114/399: ivy-hydra.el (ivy-dispatching-done-hydra): Improve, Oleh Krehel, 2019/07/20
- [elpa] master 344aebc 116/399: counsel.el (counsel-dired-jump): Improve, Oleh Krehel, 2019/07/20
- [elpa] master b27ef9e 111/399: counsel.el (counsel-git-cands): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 1b5af1e 115/399: counsel.el (counsel-file-jump-args): Adjust, Oleh Krehel, 2019/07/20
- [elpa] master 05763ae 121/399: counsel.el (counsel-git): Fix default-directory, Oleh Krehel, 2019/07/20
- [elpa] master aef1242 118/399: ivy-overlay.el (ivy-overlay-impossible-p): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 3cb9d72 120/399: ivy-overlay.el (ivy-display-function-overlay): Fix weird offset, Oleh Krehel, 2019/07/20
- [elpa] master ea6ef81 122/399: Allow recursive minibuffers to use ivy-display-function-alist, Oleh Krehel, 2019/07/20
- [elpa] master 5e54abd 123/399: Fix counsel-org-tag-agenda, Oleh Krehel, 2019/07/20
- [elpa] master 1998783 125/399: counsel.el (counsel-find-file-ignore-regexp): Add nested hidden dotfiles, Oleh Krehel, 2019/07/20
- [elpa] master bb5d0d4 119/399: ivy-overlay.el (ivy-display-function-overlay): Refactor,
Oleh Krehel <=
- [elpa] master f9b64c3 126/399: swiper.el (swiper-isearch): Add, Oleh Krehel, 2019/07/20
- [elpa] master 1606918 129/399: ivy.el (ivy-read): Allow :update-fn to be 'auto, Oleh Krehel, 2019/07/20
- [elpa] master f4431d4 133/399: doc/ivy.org (automatically integrated packages): Add, Oleh Krehel, 2019/07/20
- [elpa] master 0465711 124/399: counsel.el (counsel-org-tag-agenda): Check org-version, Oleh Krehel, 2019/07/20
- [elpa] master 3416142 128/399: counsel.el (counsel--async-sentinel): Fix index jumping randomly, Oleh Krehel, 2019/07/20
- [elpa] master 31a554d 130/399: swiper.el (swiper-isearch): Anchor to line-beginning-position, Oleh Krehel, 2019/07/20
- [elpa] master adad2e4 127/399: counsel.el: Strip space from initial input of counsel-package, Oleh Krehel, 2019/07/20
- [elpa] master df8901f 132/399: swiper.el (swiper-query-replace): Add preview overlays, Oleh Krehel, 2019/07/20
- [elpa] master dc3f469 131/399: swiper.el (swiper-isearch): Extend, Oleh Krehel, 2019/07/20
- [elpa] master bc479ed 134/399: swiper.el (swiper-isearch): Fix minibuffer height, Oleh Krehel, 2019/07/20