branch: externals/corfu commit 59a3037a3258118443d68e4d188bc225bbe15893 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Ensure that overlay is deleted properly --- corfu.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/corfu.el b/corfu.el index a15f21c..9b98861 100644 --- a/corfu.el +++ b/corfu.el @@ -428,7 +428,6 @@ 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)) @@ -480,6 +479,9 @@ Set to nil in order to disable confirmation." (defun corfu--pre-command-hook () "Insert selected candidate unless keep alive command." + (when corfu--overlay + (delete-overlay corfu--overlay) + (setq corfu--overlay nil)) (unless (or (< corfu--index 0) (corfu--keep-alive-p)) (corfu--insert 'exact)))