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

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

[nongnu] elpa/helm 37bf5e6d7c 2/4: Fix displaying thumbnails with icons


From: ELPA Syncer
Subject: [nongnu] elpa/helm 37bf5e6d7c 2/4: Fix displaying thumbnails with icons in HFF
Date: Fri, 7 Jul 2023 03:59:56 -0400 (EDT)

branch: elpa/helm
commit 37bf5e6d7c9ec21a60ff63a98ef5c2d6bc52c04c
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Fix displaying thumbnails with icons in HFF
    
    Don't show both, replace icon by thumbnail and vice versa.
---
 helm-files.el | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/helm-files.el b/helm-files.el
index 3852d47ad3..e5cb5caac5 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -5045,16 +5045,18 @@ Special commands:
                  (let ((thumbnail (plist-get
                                    (cdr 
(helm-ff--image-dired-get-thumbnail-image img))
                                    :file)))
-                   (cons (concat (propertize " "
-                                             'display `(image
-                                                        :type ,type
-                                                        :margin 5
-                                                        :file ,thumbnail)
-                                             'rear-nonsticky '(display))
-                                 disp)
-                         img))
-                 else collect (cons disp img)))
-    candidates))
+                   ;; When icons are displayed the leading space handling disp
+                   ;; prop is already here, just replace icon with the 
thumbnail.
+                   (unless helm-ff-icon-mode (setq disp (concat " " disp)))
+                   (add-text-properties 0 1 `(display (image
+                                                       :type ,type
+                                                       :margin 5
+                                                       :file ,thumbnail)
+                                                      rear-nonsticky 
'(display))
+                                        disp)
+                   (cons disp img))
+                   else collect (cons disp img)))
+        candidates))
 
 ;; Same as `image-dired-get-thumbnail-image' but use
 ;; `helm-ff--image-dired-thumb-name' which cache thumbnails for further use.
@@ -5094,8 +5096,9 @@ Special commands:
                      helm-ff--thumbnailed-directories))
     (setq helm-ff--thumbnailed-directories
           (delete helm-ff-default-directory helm-ff--thumbnailed-directories)))
-  (helm-update (regexp-quote (replace-regexp-in-string
-                              "\\`[[:multibyte:] ]*" "" (helm-get-selection 
nil t)))))
+  (helm-force-update (regexp-quote (replace-regexp-in-string
+                                    "\\`[[:multibyte:] ]*" ""
+                                    (helm-get-selection nil t)))))
 (put 'helm-ff-toggle-thumbnails 'no-helm-mx t)
 
 ;;;###autoload



reply via email to

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