summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2022-01-19 23:03:56 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2022-01-19 23:04:10 +0100
commit299f8e8e964148c73e5ebe8a9480893bf7e7bbeb (patch)
tree7696e4684229fb3c37bf248b467b7d031ee70d71
parent9796921880a30aae407c5cc358375df8bcd23fcb (diff)
corfu--completion-in-region: Terminate immediately when the completion boundary changed.
-rw-r--r--corfu.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/corfu.el b/corfu.el
index f267eaf..6e3c5fd 100644
--- a/corfu.el
+++ b/corfu.el
@@ -1087,6 +1087,11 @@ there hasn't been any input, then quit."
#'corfu--all-sorted-completions))
(apply #'completion--in-region args))
(when (and completion-in-region-mode
+ ;; Terminate immediately when the completion boundary changed.
+ ;; This happens for example when completing file names in shell
+ ;; and the terminating space is added by the :exit-function.
+ (or (funcall completion-in-region-mode--predicate)
+ (and (completion-in-region-mode -1) nil))
;; Do not show Corfu when "trivially" cycling, i.e.,
;; when the completion is finished after the candidate.
(not (and completion-cycling