branch: elpa/helm
commit 1dfabbd368a2c73646f8d5ebbaeb47cdb38e57cc
Author: Thierry Volpiatto <thie...@posteo.net>
Commit: Thierry Volpiatto <thie...@posteo.net>

    Better fix for retrieving last expanded symlink in HFF (commit 7f602741)
    
    If we concat icon+fname+->+truename, we can't retrieve anymore last
    expanded.
    If we add a display prop on whole candidate, we can retrieve last
    expanded but then helm-fuzzy-highlight-matches is confused.
    So we now concat icon+fname+a space containing "->+truename" and we
    search fname maybe ending with a space at eol.
---
 helm-files.el | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/helm-files.el b/helm-files.el
index 48de393366..c41f84f756 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -3030,7 +3030,9 @@ hitting C-j on \"..\"."
       (with-helm-window
         (when (re-search-forward
                (format helm-ff-last-expanded-candidate-regexp
-                       (concat (regexp-quote presel) "$"))
+                       ;; The space at eol may contain a display property
+                       ;; e.g. "-> symlink truename".
+                       (concat (regexp-quote presel) " ?$"))
                nil t)
           (forward-line 0)
           (helm-mark-current-line)))
@@ -4377,11 +4379,14 @@ If SKIP-BORING-CHECK is non nil don't filter boring 
files."
                    (add-face-text-property 0 len-abbrev 'helm-ff-truename t 
abbrev)
                    ;; Colorize extension only on truename.
                    (add-face-text-property 0 len 'helm-ff-symlink nil disp)
-                   (cons (helm-ff-prefix-filename
-                          ;; Use display prop instead of concating prevent
-                          ;; failure when preselecting after going up in tree 
(C-l).
-                          (propertize disp 'display (concat disp " -> " 
abbrev))
-                          file)
+                   (cons (concat (helm-ff-prefix-filename disp file)
+                                 ;; Displaying this in a space with display 
prop
+                                 ;; allows retrieving the candidate with
+                                 ;; `helm-ff-retrieve-last-expanded'.  If we 
put
+                                 ;; the display prop on the whole candidate
+                                 ;; `helm-fuzzy-highlight-matches' don't match
+                                 ;; properly.
+                                 (propertize " " 'display (concat " -> " 
abbrev)))
                          file)))
                 ;; A directory.
                 ((eq t type)

Reply via email to