diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2022-12-11 19:18:46 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2022-12-11 19:18:46 +0100 |
| commit | 6a51088d5b83236754e50a999c4d1fde6cadbe67 (patch) | |
| tree | 75e708ede4e46abfd27fa35ae5e092858ecebfec | |
| parent | 835ff2d2fba460f09f39d40c222eb4f594b60c3a (diff) | |
Fixes
| -rw-r--r-- | corfu.el | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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)) |
