[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4389a26 056/184: ivy-overlay.el (ivy-overlay-show-after):
From: |
Oleh Krehel |
Subject: |
[elpa] master 4389a26 056/184: ivy-overlay.el (ivy-overlay-show-after): Check window height better |
Date: |
Wed, 16 Oct 2019 13:14:48 -0400 (EDT) |
branch: master
commit 4389a261b30c8fbfc6e31228b33b1764221daac7
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy-overlay.el (ivy-overlay-show-after): Check window height better
Check if there are at least `ivy-height' lines available below point
in the current winodow. If not, scroll the current window enough to
make them available.
Fixes #2161
---
ivy-overlay.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/ivy-overlay.el b/ivy-overlay.el
index 7f56c6e..7a77bcf 100644
--- a/ivy-overlay.el
+++ b/ivy-overlay.el
@@ -62,6 +62,8 @@ Lines are truncated to the window width."
(when (fboundp 'company-abort)
(company-abort)))
+(defvar ivy-height)
+
(defun ivy-overlay-show-after (str)
"Display STR in an overlay at point.
@@ -71,6 +73,9 @@ Then attach the overlay to the character before point."
(progn
(move-overlay ivy-overlay-at (1- (point)) (line-end-position))
(overlay-put ivy-overlay-at 'invisible nil))
+ (let ((available-height (count-lines (point) (window-end nil t))))
+ (unless (>= available-height ivy-height)
+ (recenter (- (window-height) ivy-height 2))))
(setq ivy-overlay-at (make-overlay (1- (point)) (line-end-position)))
;; Specify face to avoid clashing with other overlays.
(overlay-put ivy-overlay-at 'face 'default)
@@ -95,7 +100,7 @@ Then attach the overlay to the character before point."
(or
(and (eq major-mode 'org-mode)
(plist-get (text-properties-at (point)) 'src-block))
- (<= (window-height) (+ ivy-height 3))
+ (<= (window-height) (+ ivy-height 2))
(= (point) (point-min))
(< (- (+ (window-width) (window-hscroll)) (current-column))
30)))
- [elpa] master 9e03f36 095/184: ivy-test.el: Turn two tests back on, (continued)
- [elpa] master 9e03f36 095/184: ivy-test.el: Turn two tests back on, Oleh Krehel, 2019/10/16
- [elpa] master 4b7b075 093/184: ivy-test.el (ivy-test-inhibit-message): Add, Oleh Krehel, 2019/10/16
- [elpa] master 967d046 091/184: ivy-test.el (counsel-yank-pop): Fix on Windows, Oleh Krehel, 2019/10/16
- [elpa] master cfbf481 089/184: Lazy load ffap, Oleh Krehel, 2019/10/16
- [elpa] master 464875a 103/184: counsel.el (counsel-mark-ring): Refactor for reducing nested let, Oleh Krehel, 2019/10/16
- [elpa] master 0c1901e 100/184: ivy.el (ivy--regex-ignore-order): Fix docstring, Oleh Krehel, 2019/10/16
- [elpa] master 6905e6c 097/184: counsel.el (counsel--rg-targets): Adjust for ivy-occur buffers, Oleh Krehel, 2019/10/16
- [elpa] master e6171e2 098/184: ivy-hydra.el (ivy-dispatching-done-hydra): Fix for ivy-resume, Oleh Krehel, 2019/10/16
- [elpa] master 943eb01 108/184: counsel.el (counsel-mark-ring): Goto actual point instead of line, Oleh Krehel, 2019/10/16
- [elpa] master 36045f7 003/184: doc/Changelog.org: Fixup, Oleh Krehel, 2019/10/16
- [elpa] master 4389a26 056/184: ivy-overlay.el (ivy-overlay-show-after): Check window height better,
Oleh Krehel <=
- [elpa] master 1332ab0 068/184: counsel.el (counsel-compile-env-pattern): Fix regex typo, Oleh Krehel, 2019/10/16
- [elpa] master beb3aee 080/184: ivy.el (ivy--directory-done): Handle "/ C-j" on remote, Oleh Krehel, 2019/10/16
- [elpa] master e62e7de 090/184: ivy-test.el (ivy-test-run-tests): Fix, Oleh Krehel, 2019/10/16
- [elpa] master 73d9f4a 083/184: Place cursor at the begging of matches (for grep), Oleh Krehel, 2019/10/16
- [elpa] master 361cf87 070/184: ivy-test.el (counsel-find-file-with-dollars): Remove, Oleh Krehel, 2019/10/16
- [elpa] master 7cca04a 088/184: doc/ivy.org: Document the marking feature, Oleh Krehel, 2019/10/16
- [elpa] master 3be5e78 084/184: counsel.el (counsel-git-grep-action): Check re-search-forward, Oleh Krehel, 2019/10/16
- [elpa] master 4c1f6cd 094/184: ivy-test.el: Update, Oleh Krehel, 2019/10/16
- [elpa] master 47f6427 105/184: counsel.el (counsel-compile): favour project root over default-directory, Oleh Krehel, 2019/10/16
- [elpa] master 09507fc 109/184: counsel.el (counsel-mark-ring): Fix highlight line of selected candidate, Oleh Krehel, 2019/10/16