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

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

[elpa] externals/corfu-doc 0c5bd800f6 71/95: Fix frame flicker When disp


From: ELPA Syncer
Subject: [elpa] externals/corfu-doc 0c5bd800f6 71/95: Fix frame flicker When display the doc immediately
Date: Tue, 19 Jul 2022 15:58:06 -0400 (EDT)

branch: externals/corfu-doc
commit 0c5bd800f689f4af765eb267df038d8068516a6e
Author: Yuwei Tian <ibluefocus@outlook.com>
Commit: Yuwei Tian <ibluefocus@outlook.com>

    Fix frame flicker When display the doc immediately
---
 corfu-doc.el | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/corfu-doc.el b/corfu-doc.el
index e0e557395e..c4ff2439e5 100644
--- a/corfu-doc.el
+++ b/corfu-doc.el
@@ -48,9 +48,12 @@
   :group 'corfu-doc)
 
 (defcustom corfu-doc-delay 0.1
-  "The number of seconds to wait before displaying the documentation popup."
-  :type 'float
-  :safe #'floatp
+  "The number of seconds to wait before displaying the documentation popup.
+
+The value of nil means no delay."
+  :type '(choice (const :tag "never (nil)" nil)
+                 (const :tag "immediate (0)" 0)
+                 (number :tag "seconds"))
   :group 'corfu-doc)
 
 (defcustom corfu-doc-hide-threshold 0.2
@@ -468,13 +471,14 @@ FWIDTH and FHEIGHT."
 
 (defun corfu-doc--popup-transit ()
   (when (corfu-doc--popup-visible-p)
-    (if (and corfu-doc-mode corfu-doc-auto (> corfu-doc-delay 0))
-        (if (> corfu-doc-delay corfu-doc-hide-threshold)
-            (corfu-doc--make-popup-invisible)
-          ;; clear buffer and update popup position immediately
-          (corfu-doc--clear-buffer)
-          (when (corfu-doc--cf-popup-edges-changed-p)
-            (corfu-doc--refresh-popup)))
+    (if (and corfu-doc-mode corfu-doc-auto)
+        (when (and (not (null corfu-doc-delay)) (> corfu-doc-delay 0))
+          (if (> corfu-doc-delay corfu-doc-hide-threshold)
+              (corfu-doc--make-popup-invisible)
+            ;; clear buffer and update popup position immediately
+            (corfu-doc--clear-buffer)
+            (when (corfu-doc--cf-popup-edges-changed-p)
+              (corfu-doc--refresh-popup))))
       (corfu-doc--popup-hide))))
 
 (defun corfu-doc--popup-show (&rest _args)



reply via email to

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