(or (plist-get plist :predicate)
completion-preview-predicate)
(- (point) beg) md))
- (last (last all)))
+ (last (last all))
+ (base (or (cdr last) 0))
+ (prefix (substring string base)))
(when last
(setcdr last nil)
- (let* ((filtered (seq-filter (apply-partially #'string-prefix-p string)
+ (let* ((filtered (seq-filter (apply-partially #'string-prefix-p prefix)
all))
(sorted (funcall sort-fn filtered))
(multi (cadr sorted)) ; multiple candidates
(when (and cand
(not (and multi completion-preview-exact-match-only)))
(let* ((face (if multi 'completion-preview 'completion-preview-exact))
- (after (propertize (substring cand (length string)) 'face face)))
+ (after (propertize (substring cand (length prefix)) 'face face)))
(unless (string-empty-p after)
(add-text-properties 0 1 '(cursor 1) after))
(setq completion-preview--overlay (make-overlay end end))