[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu-doc d857f012ad 33/95: Reduce doc frame flickering
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu-doc d857f012ad 33/95: Reduce doc frame flickering when the delay is very low |
Date: |
Tue, 19 Jul 2022 15:58:02 -0400 (EDT) |
branch: externals/corfu-doc
commit d857f012ad7ca008ab5dcc179dfe16e2d6384532
Author: Yuwei Tian <ibluefocus@outlook.com>
Commit: Yuwei Tian <ibluefocus@outlook.com>
Reduce doc frame flickering when the delay is very low
---
corfu-doc.el | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/corfu-doc.el b/corfu-doc.el
index 02e9e8d138..247936c726 100644
--- a/corfu-doc.el
+++ b/corfu-doc.el
@@ -49,6 +49,16 @@
:safe #'floatp
:group 'corfu-doc)
+(defcustom corfu-doc-hide-threshold 0.2
+ "Threshold value to hide the documentation popup when browsing candidates.
+
+When the selected candidate is changed, if the value of `corfu-doc-delay'
+is greater than this threshold value, the documentation popup frame will
+be hided immediately. Else, just clear the doc frame content."
+ :type 'float
+ :safe #'floatp
+ :group 'corfu-doc)
+
(defcustom corfu-doc-max-width 60
"The max width of the corfu doc frame in characters."
:type 'integer
@@ -293,6 +303,12 @@ If this is nil, do not resize corfu doc frame
automatically."
(and (> corfu--total 0)
(nth corfu--index corfu--candidates)))
+(defun corfu-doc--clear-buffer ()
+ (with-current-buffer
+ (window-buffer (frame-root-window corfu-doc--frame))
+ (let ((inhibit-read-only t))
+ (erase-buffer))))
+
(defun corfu-doc--show ()
(when (and (and (fboundp 'corfu-mode) corfu-mode)
(frame-visible-p corfu--frame))
@@ -332,7 +348,9 @@ If this is nil, do not resize corfu doc frame
automatically."
(eq (selected-window) corfu-doc--window))
(when (and (frame-live-p corfu-doc--frame)
(frame-visible-p corfu-doc--frame))
- (make-frame-invisible corfu-doc--frame))))
+ (if (> corfu-doc-delay corfu-doc-hide-threshold)
+ (make-frame-invisible corfu-doc--frame)
+ (corfu-doc--clear-buffer)))))
(when (or (null corfu-doc--timer)
(eq this-command #'corfu-doc-manually))
(setq corfu-doc--timer
@@ -350,10 +368,7 @@ If this is nil, do not resize corfu doc frame
automatically."
(defun corfu-doc--hide ()
(when (frame-live-p corfu-doc--frame)
(make-frame-invisible corfu-doc--frame)
- (with-current-buffer
- (window-buffer (frame-root-window corfu-doc--frame))
- (let ((inhibit-read-only t))
- (erase-buffer)))
+ (corfu-doc--clear-buffer)
(setq corfu-doc--candidate nil)
(setq corfu-doc--cf-frame-edges nil)
(setq corfu-doc--window nil)))
- [elpa] branch externals/corfu-doc created (now da93136780), ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 11b9f0fefa 18/95: Add an option to resize the corfu doc frame automatically, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc d611165b7d 42/95: Reduce the popup height to avoid exceeding the display, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc c14d42e5e2 55/95: Version 0.4.3, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc c968530f74 50/95: Fix #9: fix showing doc while quickly browsing candidates, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc e9562c3936 48/95: Update commentary, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc d857f012ad 33/95: Reduce doc frame flickering when the delay is very low,
ELPA Syncer <=
- [elpa] externals/corfu-doc 45853ecb53 24/95: Version 0.1.0, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc dcc481a5d0 58/95: Document display the doc frame within the parent frame, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc e1c79e8ffc 27/95: Version 0.1.1, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 1fd578caa0 53/95: Fix link, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc d2abf185e6 75/95: Rename corfu-doc--popup-transit to corfu-doc--popup-transition, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 07d389a0ab 74/95: Make candidates popup and doc popup share the border, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 832b49e2a1 83/95: Remove :safe args, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc be90c96079 84/95: Merge functions to get the documentation of the candidate, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 13574ae5d1 82/95: Make corfu-doc-display-within-parent-frame default to t, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 616a2a9fc6 93/95: Fix regression error when scrolling doc popup, ELPA Syncer, 2022/07/19