summaryrefslogtreecommitdiff
path: root/corfu.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2021-10-11 17:06:55 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2021-10-11 17:07:05 +0200
commitf30dc711a67c4fac049dd44c4a143249a3cd191f (patch)
tree2fb9bb2e500a7a3ea1ed0dc127212a10bf0ece4d /corfu.el
parent7e0c9f767cce0b6a02cb02a3132844c0adcaedf4 (diff)
Check that completion field is non-empty
Diffstat (limited to 'corfu.el')
-rw-r--r--corfu.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/corfu.el b/corfu.el
index 55bcc0b..ef44df8 100644
--- a/corfu.el
+++ b/corfu.el
@@ -529,10 +529,11 @@ completion began less than that number of seconds ago."
(setq all (if-let (sort (corfu--metadata-get metadata 'display-sort-function))
(funcall sort all)
(sort all #'corfu--sort-predicate)))
- (setq all (corfu--move-prefix-candidates-to-front field all))
- (when (and completing-file (not (string-suffix-p "/" field)))
- (setq all (corfu--move-to-front (concat field "/") all)))
- (setq all (corfu--move-to-front field all))
+ (unless (equal field "")
+ (setq all (corfu--move-prefix-candidates-to-front field all))
+ (when (and completing-file (not (string-suffix-p "/" field)))
+ (setq all (corfu--move-to-front (concat field "/") all)))
+ (setq all (corfu--move-to-front field all)))
(list base (length all) all hl)))
(defun corfu--update-candidates (str metadata pt table pred)