emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 03/16: company-pseudo-tooltip-frontend: Small rewrite


From: Dmitry Gutov
Subject: [elpa] 03/16: company-pseudo-tooltip-frontend: Small rewrite
Date: Sat, 26 Jul 2014 04:53:19 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit e5cb0c088199671b2fee598cad3b751b99673104
Author: Dmitry Gutov <address@hidden>
Date:   Mon Jul 14 06:32:03 2014 +0300

    company-pseudo-tooltip-frontend: Small rewrite
---
 company.el |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/company.el b/company.el
index 8049e37..9e44c77 100644
--- a/company.el
+++ b/company.el
@@ -2435,20 +2435,20 @@ Returns a negative number if the tooltip should be 
displayed above point."
   (cl-case command
     (pre-command (company-pseudo-tooltip-hide-temporarily))
     (post-command
-     (let ((old-height (if (overlayp company-pseudo-tooltip-overlay)
-                           (overlay-get company-pseudo-tooltip-overlay
-                                        'company-height)
-                         0))
-           (new-height (company--pseudo-tooltip-height)))
-       (unless (and (>= (* old-height new-height) 0)
-                    (>= (abs old-height) (abs new-height))
-                    (equal (company-pseudo-tooltip-guard)
-                           (overlay-get company-pseudo-tooltip-overlay
-                                        'company-guard)))
-         ;; Redraw needed.
-         (company-pseudo-tooltip-show-at-point (point) (length company-prefix))
-         (overlay-put company-pseudo-tooltip-overlay
-                      'company-guard (company-pseudo-tooltip-guard))))
+     (unless (and
+              (overlayp company-pseudo-tooltip-overlay)
+              (let* ((ov company-pseudo-tooltip-overlay)
+                     (old-height (overlay-get ov 'company-height))
+                     (new-height (company--pseudo-tooltip-height)))
+                (and
+                 (>= (* old-height new-height) 0)
+                 (>= (abs old-height) (abs new-height))
+                 (equal (company-pseudo-tooltip-guard)
+                        (overlay-get ov 'company-guard)))))
+       ;; Redraw needed.
+       (company-pseudo-tooltip-show-at-point (point) (length company-prefix))
+       (overlay-put company-pseudo-tooltip-overlay
+                    'company-guard (company-pseudo-tooltip-guard)))
      (company-pseudo-tooltip-unhide))
     (hide (company-pseudo-tooltip-hide)
           (setq company-tooltip-offset 0))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]