From ed4ef0fe1aed50494e59a9075566b72e8dfd3925 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Fri, 26 Nov 2021 00:04:49 +0100 Subject: Remove overlay in pre-command-hook --- corfu.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/corfu.el b/corfu.el index 02a74e2..f67277d 100644 --- a/corfu.el +++ b/corfu.el @@ -779,9 +779,6 @@ there hasn't been any input, then quit." (corfu--match-symbol-p corfu-continue-commands this-command)))) (corfu--echo-refresh) - (when corfu--preview-ov - (delete-overlay corfu--preview-ov) - (setq corfu--preview-ov nil)) (cond ;; XXX Guard against errors during candidate generation. ;; Turn off completion immediately if there are errors @@ -829,6 +826,9 @@ there hasn't been any input, then quit." (defun corfu--pre-command () "Insert selected candidate unless command is marked to continue completion." (add-hook 'window-configuration-change-hook #'corfu-quit) + (when corfu--preview-ov + (delete-overlay corfu--preview-ov) + (setq corfu--preview-ov nil)) (when (and corfu-commit-predicate (not (corfu--match-symbol-p corfu-continue-commands this-command)) (funcall corfu-commit-predicate)) -- cgit v1.0