From f30dc711a67c4fac049dd44c4a143249a3cd191f Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Mon, 11 Oct 2021 17:06:55 +0200 Subject: Check that completion field is non-empty --- corfu.el | 9 +++++---- 1 file 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) -- cgit v1.0