summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2022-11-21 22:36:03 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2022-11-21 22:36:03 +0100
commitf8bed9212eb79bbcdade7ab3104702a3a118cfe2 (patch)
tree4fc91c319e5af8f78777b0232eda8c9ad169989e
parent076073dd3d17f66cfd398cad4125cf6703b42a46 (diff)
corfu-popupinfo: Fix timer handling
-rw-r--r--extensions/corfu-echo.el2
-rw-r--r--extensions/corfu-popupinfo.el11
2 files changed, 7 insertions, 6 deletions
diff --git a/extensions/corfu-echo.el b/extensions/corfu-echo.el
index 21637b7..4613e0b 100644
--- a/extensions/corfu-echo.el
+++ b/extensions/corfu-echo.el
@@ -39,7 +39,7 @@
"Face used for echo area messages."
:group 'corfu-faces)
-(defcustom corfu-echo-delay '(1.0 . 0.5)
+(defcustom corfu-echo-delay '(2.0 . 1.0)
"Show documentation string in the echo area after that number of seconds.
Set to t for an instant message. The value can be a pair of two
floats to specify initial and subsequent delay."
diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el
index 6dcece1..0fff73f 100644
--- a/extensions/corfu-popupinfo.el
+++ b/extensions/corfu-popupinfo.el
@@ -54,7 +54,7 @@
"Face used for the info popup."
:group 'corfu-faces)
-(defcustom corfu-popupinfo-delay '(1.0 . 0.5)
+(defcustom corfu-popupinfo-delay '(2.0 . 1.0)
"Automatically update info popup after that number of seconds.
Set to t for an instant update. The value can be a pair of two
@@ -362,6 +362,7 @@ the candidate popup, its value is 'bottom, 'top, 'right or 'left."
(corfu--make-frame corfu-popupinfo--frame
area-x area-y area-w area-h
" *corfu-popupinfo*")
+ corfu-popupinfo--toggle t
corfu-popupinfo--direction area-d
corfu-popupinfo--candidate candidate
corfu-popupinfo--coordinates new-coords)
@@ -437,15 +438,15 @@ not be displayed until this command is called again, even if
(when completion-in-region-mode
(setf (alist-get #'corfu-popupinfo-mode minor-mode-overriding-map-alist)
corfu-popupinfo-map)
+ (when corfu-popupinfo--timer
+ (cancel-timer corfu-popupinfo--timer)
+ (setq corfu-popupinfo--timer nil))
(if (and (>= corfu--index 0) (corfu-popupinfo--visible-p corfu--frame))
(when-let* ((delay (if (consp corfu-popupinfo-delay)
- (funcall (if (corfu-popupinfo--visible-p) #'cdr #'car)
+ (funcall (if (eq corfu-popupinfo--toggle 'init) #'car #'cdr)
corfu-popupinfo-delay)
corfu-popupinfo-delay))
(corfu-popupinfo--toggle))
- (when corfu-popupinfo--timer
- (cancel-timer corfu-popupinfo--timer)
- (setq corfu-popupinfo--timer nil))
(let ((candidate (nth corfu--index corfu--candidates)))
(if (or (eq delay t) (<= delay 0)
(equal candidate corfu-popupinfo--candidate))