From 3e0e65f50a3060014d4b376a047607b8cf365032 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 17 Oct 2021 15:22:56 +0200 Subject: Allow corfu-commit-predicate=nil --- corfu.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/corfu.el b/corfu.el index ab7a544..af2a7c3 100644 --- a/corfu.el +++ b/corfu.el @@ -68,7 +68,7 @@ (defcustom corfu-commit-predicate #'corfu-candidate-selected-p "Automatically commit if the predicate returns t." - :type 'function) + :type '(choice (const nil) function)) (defcustom corfu-quit-at-boundary nil "Automatically quit at completion field/word boundary. @@ -696,7 +696,7 @@ completion began less than that number of seconds ago." "Insert selected candidate unless command is marked to continue completion." (add-hook 'window-configuration-change-hook #'corfu-quit) (unless (corfu--match-symbol-p corfu-continue-commands this-command) - (if (funcall corfu-commit-predicate) + (if (and corfu-commit-predicate (funcall corfu-commit-predicate)) (corfu--insert 'exact) (setq corfu--index -1)))) -- cgit v1.0