summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2022-12-11 19:18:46 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2022-12-11 19:18:46 +0100
commit6a51088d5b83236754e50a999c4d1fde6cadbe67 (patch)
tree75e708ede4e46abfd27fa35ae5e092858ecebfec
parent835ff2d2fba460f09f39d40c222eb4f594b60c3a (diff)
Fixes
-rw-r--r--corfu.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/corfu.el b/corfu.el
index 4270a76..543a23a 100644
--- a/corfu.el
+++ b/corfu.el
@@ -1140,15 +1140,15 @@ ASYNC may be an asynchronous capf result."
;; Ask the backend for refreshing
(funcall fun (lambda (ret)
;; TODO ensure that this runs in the correct buffer.
- (pcase ret
- (`(,beg ,end ,table . ,plist)
- ;; TODO Check validity of boundaries.
- ;; If valid, update UI. Otherwise quit.
- (corfu--post-command))
- (_ (corfu-quit)))))
- ;; Return t, since the predicate is invoked asynchronously
+ (if-let* ((newbeg (car-safe ret))
+ ((= newbeg beg)))
+ (corfu--post-command)
+ (corfu-quit))))
+ ;; Return t, since the predicate is invoked asynchronously.
t)
- (lambda () (eq beg (car-safe (funcall fun))))))
+ (lambda ()
+ (when-let (newbeg (car-safe (funcall fun)))
+ (= newbeg beg)))))
(completion-extra-properties plist))
(setq completion-in-region--data
(list (if (markerp beg) beg (copy-marker beg))