[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu b76e2e7fb7 1/3: Defer popup hiding (Fix #184)
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu b76e2e7fb7 1/3: Defer popup hiding (Fix #184) |
Date: |
Fri, 3 Jun 2022 08:57:25 -0400 (EDT) |
branch: externals/corfu
commit b76e2e7fb7eb7d9415fd9dc72134fda048fecd46
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Defer popup hiding (Fix #184)
---
corfu.el | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/corfu.el b/corfu.el
index 94427f5a3a..25dbfa231f 100644
--- a/corfu.el
+++ b/corfu.el
@@ -492,10 +492,15 @@ A scroll bar is displayed from LO to LO+BAR."
(defun corfu--popup-hide ()
"Hide Corfu popup."
(when (frame-live-p corfu--frame)
- (make-frame-invisible corfu--frame)
- (with-current-buffer (window-buffer (frame-root-window corfu--frame))
- (let ((inhibit-read-only t))
- (erase-buffer)))))
+ ;; Redisplay such that the input becomes immediately visible before the
popup
+ ;; hiding, which is slow (Issue #48). See also corresponding vertico#89.
+ (redisplay)
+ (run-at-time 0 nil (lambda ()
+ (when (frame-live-p corfu--frame)
+ (make-frame-invisible corfu--frame)
+ (with-current-buffer (window-buffer
(frame-root-window corfu--frame))
+ (let ((inhibit-read-only t))
+ (erase-buffer))))))))
(defun corfu--popup-support-p ()
"Return non-nil if child frames are supported."
@@ -1071,9 +1076,6 @@ Quit if no candidate is selected."
(defun corfu--teardown ()
"Teardown Corfu."
- ;; Redisplay such that the input becomes immediately visible before the popup
- ;; hiding, which is slow (Issue #48). See also corresponding vertico#89.
- (redisplay)
(corfu--popup-hide)
(remove-hook 'pre-command-hook #'corfu--pre-command 'local)
(remove-hook 'post-command-hook #'corfu--post-command)