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

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

[nongnu] elpa/helm 1d952d0344: Fix buffers preselection with icons


From: ELPA Syncer
Subject: [nongnu] elpa/helm 1d952d0344: Fix buffers preselection with icons
Date: Wed, 2 Nov 2022 05:58:56 -0400 (EDT)

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

    Fix buffers preselection with icons
---
 helm-buffers.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/helm-buffers.el b/helm-buffers.el
index 17a329392a..43c9c73a53 100644
--- a/helm-buffers.el
+++ b/helm-buffers.el
@@ -572,7 +572,10 @@ buffers)."
                            (get-buffer i)))))
 
 (defun helm-buffer--get-preselection (buffer)
-  (let ((bufname (buffer-name buffer)))
+  (let* ((bufname     (buffer-name buffer))
+         (dispbuf     (car (helm-buffer--details buffer)))
+         (len-dispbuf (string-width dispbuf))
+         (len-prefix  (- len-dispbuf (string-width bufname))))
     (when (and bufname
                (file-remote-p (with-current-buffer bufname
                                 default-directory)))
@@ -580,11 +583,11 @@ buffers)."
     (concat "^[[:multibyte:] ]*"
             (if (and (null helm-buffer-details-flag)
                      (numberp helm-buffer-max-length)
-                     (> (string-width bufname)
-                        helm-buffer-max-length))
+                     (> len-dispbuf helm-buffer-max-length))
                 (regexp-quote
                  (helm-substring-by-width
-                  bufname helm-buffer-max-length
+                  bufname
+                  (- helm-buffer-max-length len-prefix)
                   helm-buffers-end-truncated-string))
               (concat (regexp-quote bufname)
                       (if helm-buffer-details-flag



reply via email to

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