branch: externals/marginalia
commit e41d9398f82b336cab8ce9fa64317f759b92a1f7
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
Revert "Go back and use full minibuffer-contents for marginalia--full-file"
This reverts commit 95c0bb3a39e9b3db0719aa695efb36291f49e8fe.
It is actually correct to take the point position into account. The
completion
system should update the candidate list when updating the point.
---
marginalia.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/marginalia.el b/marginalia.el
index 446b1a6..ffc68b2 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -646,12 +646,15 @@ The string is transformed according to
`marginalia-bookmark-type-transformers'."
(if-let (win (active-minibuffer-window))
(with-current-buffer (window-buffer win)
(let* ((contents (minibuffer-contents-no-properties))
+ (pt (- (point) (minibuffer-prompt-end)))
+ (before (substring contents 0 pt))
+ (after (substring contents pt))
(bounds (completion-boundaries
- contents
+ before
minibuffer-completion-table
minibuffer-completion-predicate
- ""))
- (components (split-string (substring contents 0 (car bounds))
"/"))
+ after))
+ (components (split-string (substring before 0 (car bounds))
"/"))
(num-replace (if (string-suffix-p "/" file)
(cl-count ?/ file)
(1+ (cl-count ?/ file))) ))