[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/company 0331a73: Fix tooltip's 'unhide' on a visually w
From: |
ELPA Syncer |
Subject: |
[elpa] externals/company 0331a73: Fix tooltip's 'unhide' on a visually wrapped line |
Date: |
Sat, 15 May 2021 22:57:06 -0400 (EDT) |
branch: externals/company
commit 0331a7311a4697306f5f5e4312959acb794ad8cc
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Fix tooltip's 'unhide' on a visually wrapped line
#1073
---
company.el | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/company.el b/company.el
index 24ccbfe..1874c8f 100644
--- a/company.el
+++ b/company.el
@@ -3335,7 +3335,18 @@ Returns a negative number if the tooltip should be
displayed above point."
"`company-mode' frontend similar to a tooltip but based on overlays."
(cl-case command
(pre-command (company-pseudo-tooltip-hide-temporarily))
- (unhide (company-pseudo-tooltip-unhide))
+ (unhide
+ (let ((ov company-pseudo-tooltip-overlay))
+ (when (> (overlay-get ov 'company-height) 0)
+ ;; Sleight of hand: if the current line wraps, we adjust the
+ ;; start of the overlay so that the popup does not zig-zag,
+ ;; but don't update the popup's background. This seems just
+ ;; non-annoying enough to avoid the work required for the latter.
+ (save-excursion
+ (vertical-motion 1)
+ (unless (= (point) (overlay-start ov))
+ (move-overlay ov (point) (overlay-end ov))))))
+ (company-pseudo-tooltip-unhide))
(post-command
(unless (when (overlayp company-pseudo-tooltip-overlay)
(let* ((ov company-pseudo-tooltip-overlay)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/company 0331a73: Fix tooltip's 'unhide' on a visually wrapped line,
ELPA Syncer <=