From ddeb31afd1c73a92ba9f0908889fce28bad0f238 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Mon, 8 Nov 2021 12:47:22 +0100 Subject: corfu--format-candidates: No separator space if suffix is missing --- corfu.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/corfu.el b/corfu.el index 5f3f228..fbc428a 100644 --- a/corfu.el +++ b/corfu.el @@ -590,10 +590,11 @@ completion began less than that number of seconds ago." (cl-loop for c in cands collect (cl-loop for s in c collect (string-trim (replace-regexp-in-string "[ \t]*\n[ \t]*" " " s))))) - (let* ((cw (1+ (cl-loop for x in cands maximize (string-width (car x))))) + (let* ((cw (cl-loop for x in cands maximize (string-width (car x)))) (pw (cl-loop for x in cands maximize (string-width (cadr x)))) (pw (if (> pw 0) (1+ pw) 0)) (sw (cl-loop for x in cands maximize (string-width (caddr x)))) + (sw (if (> sw 0) (1+ sw) 0)) (width (+ pw cw sw))) (when (< width corfu-min-width) (setq cw (+ cw (- corfu-min-width width)) -- cgit v1.0