branch: externals/company commit 0331a7311a4697306f5f5e4312959acb794ad8cc Author: Dmitry Gutov <dgu...@yandex.ru> Commit: Dmitry Gutov <dgu...@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)