summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2021-10-17 15:22:56 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2021-10-17 15:22:56 +0200
commit3e0e65f50a3060014d4b376a047607b8cf365032 (patch)
treee343dfb90ab8a4baf7422020f32e9c848b23b533
parent676395fbb5784a50f54985026d76929daee8ee4c (diff)
Allow corfu-commit-predicate=nil
-rw-r--r--corfu.el4
1 files 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))))