branch: externals/corfu commit 299f8e8e964148c73e5ebe8a9480893bf7e7bbeb Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
corfu--completion-in-region: Terminate immediately when the completion boundary changed. --- corfu.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/corfu.el b/corfu.el index f267eaf00d..6e3c5fdf18 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