summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2022-02-12 20:57:08 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2022-02-12 20:57:25 +0100
commitdf6431381471983bd53e1ae8bec6e48dc97b954f (patch)
treeadc871f10f36968b0aee02bd257fbadba53a7eb7
parent8dd1cb7d17353f01158843155a0df87e1b204a4c (diff)
Redisplay popup after preview overlay to avoid flicker
-rw-r--r--corfu.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/corfu.el b/corfu.el
index 02d1430..b9f0767 100644
--- a/corfu.el
+++ b/corfu.el
@@ -448,8 +448,7 @@ The completion backend can override this with
;; XXX HACK: Force redisplay, otherwise the popup sometimes does not display content.
(set-frame-position corfu--frame x y)
(redisplay 'force)
- (make-frame-visible corfu--frame))
- (redisplay 'force)))
+ (make-frame-visible corfu--frame))))
(defun corfu--popup-show (pos off width lines &optional curr lo bar)
"Show LINES as popup at POS - OFF.
@@ -830,15 +829,17 @@ there hasn't been any input, then quit."
;; 3) There exist candidates => Show candidates popup.
(corfu--candidates
(corfu--candidates-popup beg)
+ (corfu--preview-current beg end str)
(corfu--echo-documentation)
- (corfu--preview-current beg end str))
+ (redisplay 'force)) ;; XXX HACK Ensure that popup is redisplayed
;; 4) There are no candidates & corfu-quit-no-match => Confirmation popup.
((and (not corfu--candidates)
(pcase-exhaustive corfu-quit-no-match
('t nil)
('nil t)
('separator (seq-contains-p (car corfu--input) corfu-separator))))
- (corfu--popup-show beg 0 8 '(#("No match" 0 8 (face italic)))))
+ (corfu--popup-show beg 0 8 '(#("No match" 0 8 (face italic))))
+ (redisplay 'force)) ;; XXX HACK Ensure that popup is redisplayed
(t (corfu-quit)))))
(defun corfu--pre-command ()