From 87f037d8c3573ec38f8773dadd3ce9298e9104cd Mon Sep 17 00:00:00 2001 From: Samer Masterson Date: Fri, 11 Nov 2022 22:40:41 +0000 Subject: [PATCH] Respect helm-buffer-max-length if it's nil Don't overwrite helm-buffer-max-length when it's nil, because nil indicates that we should use the max length of the longest file every time. This code is now the same as what helm-buffers does: https://github.com/emacs-helm/helm/blob/8ed0ab7762ad76da02d8832aa18d03e1288ea6d5/helm-buffers.el#L300 --- helm-projectile.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helm-projectile.el b/helm-projectile.el index ae1abb3..abe23d9 100644 --- a/helm-projectile.el +++ b/helm-projectile.el @@ -670,12 +670,12 @@ Meant to be added to `helm-cleanup-hook', from which it removes (symbol-name major-mode))) into len-mode finally return (cons len-buf len-mode)))) - (unless helm-buffer-max-length - (setq helm-buffer-max-length (car result))) - (unless helm-buffer-max-len-mode + (unless (default-value 'helm-buffer-max-length) + (helm-set-local-variable 'helm-buffer-max-length (car result))) + (unless (default-value 'helm-buffer-max-len-mode) ;; If a new buffer is longer that this value ;; this value will be updated - (setq helm-buffer-max-len-mode (cdr result)))))) + (helm-set-local-variable 'helm-buffer-max-len-mode (cdr result)))))) (candidates :initform helm-projectile-buffers-list-cache) (matchplugin :initform nil) (match :initform 'helm-buffers-match-function)