summaryrefslogtreecommitdiff
path: root/cape.el
diff options
context:
space:
mode:
Diffstat (limited to 'cape.el')
-rw-r--r--cape.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/cape.el b/cape.el
index d77051a..13c1e5d 100644
--- a/cape.el
+++ b/cape.el
@@ -884,10 +884,11 @@ If INTERACTIVE is nil the function acts like a capf."
(when (eq res 'cape--waiting)
(push 'cape--done unread-command-events))
(setq res arg)))
- (let ((input-method-function nil))
- (read-event nil t))
- (when (eq res 'cape--waiting)
- (throw toi t)))
+ (let ((ev (let (input-method-function) (read-event nil t))))
+ (when (eq res 'cape--waiting)
+ (unless (eq ev 'cape--done)
+ (push (cons t ev) unread-command-events))
+ (throw toi t))))
(setq unread-command-events
(delq 'cape--done unread-command-events)))
(funcall fetch (lambda (arg) (setq res arg)))