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

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

[elpa] master c08dbc1 039/173: Don't use `sit-for'


From: Dmitry Gutov
Subject: [elpa] master c08dbc1 039/173: Don't use `sit-for'
Date: Thu, 23 Jun 2016 00:28:36 +0000 (UTC)

branch: master
commit c08dbc18f76de7275368780e564947453cb7bce6
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Don't use `sit-for'
    
    Fixes #353 (global-hl-line-mode flickering).
---
 company.el |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/company.el b/company.el
index 9163749..ec42103 100644
--- a/company.el
+++ b/company.el
@@ -1508,6 +1508,7 @@ from the rest of the back-ends in the group, if any, will 
be left at the end."
           company-point nil)
     (when company-timer
       (cancel-timer company-timer))
+    (company-echo-cancel t)
     (company-search-mode 0)
     (company-call-frontends 'hide)
     (company-enable-overriding-keymap nil))
@@ -1538,6 +1539,7 @@ from the rest of the back-ends in the group, if any, will 
be left at the end."
   (when company-timer
     (cancel-timer company-timer)
     (setq company-timer nil))
+  (company-echo-cancel t)
   (company-uninstall-map))
 
 (defun company-post-command ()
@@ -2751,13 +2753,19 @@ Returns a negative number if the tooltip should be 
displayed above point."
       (message ""))))
 
 (defun company-echo-show-soon (&optional getter)
+  (company-echo-cancel)
+  (setq company-echo-timer (run-with-timer 0 nil 'company-echo-show getter)))
+
+(defun company-echo-cancel (&optional unset)
   (when company-echo-timer
     (cancel-timer company-echo-timer))
-  (setq company-echo-timer (run-with-timer 0 nil 'company-echo-show getter)))
+  (when unset
+    (setq company-echo-timer nil)))
 
-(defsubst company-echo-show-when-idle (&optional getter)
-  (when (sit-for company-echo-delay)
-    (company-echo-show getter)))
+(defun company-echo-show-when-idle (&optional getter)
+  (company-echo-cancel)
+  (setq company-echo-timer
+        (run-with-idle-timer company-echo-delay nil 'company-echo-show 
getter)))
 
 (defun company-echo-format ()
 



reply via email to

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