emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/marginalia e41d939 206/241: Revert "Go back and use ful


From: Stefan Monnier
Subject: [elpa] externals/marginalia e41d939 206/241: Revert "Go back and use full minibuffer-contents for marginalia--full-file"
Date: Fri, 28 May 2021 20:49:28 -0400 (EDT)

branch: externals/marginalia
commit e41d9398f82b336cab8ce9fa64317f759b92a1f7
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    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))) ))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]