From b36723febe9afac11f5bfd332513b5ad16bf99c4 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 8 Jun 2024 08:50:19 +0200 Subject: [PATCH] Improve 'basic' completion candidates highlighting (Bug#71419) --- lisp/minibuffer.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 9c3a4637133..83bd84861fb 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -4532,14 +4532,13 @@ Return the new suffix." (let* ((beforepoint (substring string 0 point)) (afterpoint (substring string point)) (bounds (completion-boundaries beforepoint table pred afterpoint)) - ;; (suffix (substring afterpoint (cdr bounds))) (prefix (substring beforepoint 0 (car bounds))) - (pattern (delete - "" (list (substring beforepoint (car bounds)) - 'point - (substring afterpoint 0 (cdr bounds))))) + (pattern + (delete "" (completion-basic--pattern beforepoint afterpoint bounds))) (all (completion-pcm--all-completions prefix pattern table pred))) - (completion-hilit-commonality all point (car bounds)))) + (when all + (nconc (completion-pcm--hilit-commonality pattern all) + (car bounds))))) ;;; Partial-completion-mode style completion. -- 2.39.5