branch: externals/marginalia commit 376ccc548f56c2a9d086814231337b5a7198bea3 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Revert "fix marginalia--full-candidate for selectrum" This reverts commit f39556bb45e0affd23da2b7b8c6841f68648fb7f. --- marginalia.el | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/marginalia.el b/marginalia.el index 539f598..5215762 100644 --- a/marginalia.el +++ b/marginalia.el @@ -318,28 +318,20 @@ component of a full file path. This function returns what would be the minibuffer contents after using `minibuffer-force-complete' on the candidate CAND." - (or - ;; Selectrum allows access to the full-candidate via property - ;; TODO The generic method which follows, does not work yet with selectrum. - ;; https://github.com/raxod502/selectrum/issues/255 - (get-text-property 0 'selectrum-candidate-full cand) - - ;; When in the minibuffer, use the minibuffer contents to expand the candidate. - (and (minibufferp) - (let* ((contents (minibuffer-contents)) - (pt (- (point) (minibuffer-prompt-end))) - (bounds (completion-boundaries - (substring contents 0 pt) - minibuffer-completion-table - minibuffer-completion-predicate - (substring contents pt)))) - (concat (substring contents 0 (car bounds)) - cand - (substring contents (+ pt (cdr bounds)))))) - - ;; Not in a minibuffer, trust that cand already conveys all - ;; information, since there is nothing we can do. - cand)) + (if (minibufferp) + (let* ((contents (minibuffer-contents)) + (pt (- (point) (minibuffer-prompt-end))) + (bounds (completion-boundaries + (substring contents 0 pt) + minibuffer-completion-table + minibuffer-completion-predicate + (substring contents pt)))) + (concat (substring contents 0 (car bounds)) + cand + (substring contents (+ pt (cdr bounds))))) + ;; not in a minibuffer, trust that cand already conveys all + ;; necessary information (there's not much else we can do) + cand)) (defun marginalia-annotate-file (cand) "Annotate file CAND with its size and modification time."