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

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

[elpa] externals/corfu-doc c968530f74 50/95: Fix #9: fix showing doc whi


From: ELPA Syncer
Subject: [elpa] externals/corfu-doc c968530f74 50/95: Fix #9: fix showing doc while quickly browsing candidates
Date: Tue, 19 Jul 2022 15:58:03 -0400 (EDT)

branch: externals/corfu-doc
commit c968530f748bdf30c56cf8221109d4cc23558dbf
Author: Frédéric Giquel <frederic.giquel@laposte.net>
Commit: Yuwei Tian <ibluefocus@outlook.com>

    Fix #9: fix showing doc while quickly browsing candidates
    
    This fixes a problem pointed out by
    Frédéric Giquel <frederic.giquel@laposte.net>.
---
 corfu-doc.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/corfu-doc.el b/corfu-doc.el
index 87036ebad7..aa9b0c83f1 100644
--- a/corfu-doc.el
+++ b/corfu-doc.el
@@ -340,9 +340,10 @@ FWIDTH and FHEIGHT."
     (setq corfu-doc--cf-frame-edges nil)
     (setq corfu-doc--window nil)))
 
-(defun corfu-doc--show ()
+(defun corfu-doc--show (&optional candidate-index)
   (when (and (and (fboundp 'corfu-mode) corfu-mode)
-             (frame-visible-p corfu--frame))
+             (frame-visible-p corfu--frame)
+             (equal candidate-index corfu--index))
     (when-let ((candidate (corfu-doc--get-candidate))
                (cf-frame-edges (frame-edges corfu--frame 'inner)))
       (if (and (string= candidate corfu-doc--candidate)
@@ -423,7 +424,7 @@ FWIDTH and FHEIGHT."
           (corfu-doc--hide)))))
   (when (and corfu-doc-mode corfu-doc-auto)
     (setq corfu-doc--timer
-          (run-with-timer corfu-doc-delay nil #'corfu-doc--show))))
+          (run-with-timer corfu-doc-delay nil #'corfu-doc--show 
corfu--index))))
 
 (defun corfu-doc--cleanup ()
   (advice-remove 'corfu--popup-hide #'corfu-doc--cleanup)



reply via email to

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