branch: externals/corfu
commit a605fc37e26c6eb60a6bda1fb83b2680bccbabd9
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    Delete overlay before update
---
 corfu.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/corfu.el b/corfu.el
index 5db2f8a..51ab8f2 100644
--- a/corfu.el
+++ b/corfu.el
@@ -407,6 +407,7 @@ Set to nil in order to disable confirmation."
          (cands (funcall corfu--highlight (seq-subseq corfu--candidates start 
last)))
          (ann-cands (mapcar #'corfu--format-candidate (corfu--annotate 
metadata cands))))
     (when (>= curr 0)
+      (when corfu--overlay (delete-overlay corfu--overlay))
       (setq corfu--overlay (make-overlay beg end nil t t))
       (overlay-put corfu--overlay 'priority 1000)
       (overlay-put corfu--overlay 'window (selected-window))
@@ -459,9 +460,6 @@ Set to nil in order to disable confirmation."
 (defun corfu--pre-command-hook ()
   "Insert selected candidate unless keep alive command."
   (add-hook 'window-configuration-change-hook #'corfu--hide)
-  (when corfu--overlay
-    (delete-overlay corfu--overlay)
-    (setq corfu--overlay nil))
   (unless (or (< corfu--index 0) (corfu--keep-alive-p))
     (corfu--insert 'exact)))
 

Reply via email to