branch: elpa/magit commit c847b2dde5e9f7b09545fab7e33510a8da5f9895 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
magit-refs--maybe-format-margin: Replace magit-refs--format-margin --- lisp/magit-refs.el | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lisp/magit-refs.el b/lisp/magit-refs.el index 43a437b4f11..0a51284a0e2 100644 --- a/lisp/magit-refs.el +++ b/lisp/magit-refs.el @@ -556,8 +556,8 @@ line is inserted at all." (length tag))) ?\s) (and msg (magit-log--wash-summary msg))) - (when (and magit-refs-margin-for-tags (magit-buffer-margin-p)) - (magit-refs--format-margin tag)) + (when magit-refs-margin-for-tags + (magit-refs--maybe-format-margin tag)) (magit-refs--insert-cherry-commits tag))))) (insert ?\n) (magit-make-margin-overlay))))) @@ -611,8 +611,7 @@ line is inserted at all." (length abbrev))) ?\s) (and msg (magit-log--wash-summary msg)))) - (when (magit-buffer-margin-p) - (magit-refs--format-margin branch)) + (magit-refs--maybe-format-margin branch) (magit-refs--insert-cherry-commits branch)))))))) (insert ?\n) (magit-make-margin-overlay)))) @@ -628,8 +627,7 @@ line is inserted at all." (or branch (magit-rev-parse "HEAD")) t) (apply #'magit-insert-heading strings) - (when (magit-buffer-margin-p) - (magit-refs--format-margin branch)) + (magit-refs--maybe-format-margin branch) (magit-refs--insert-cherry-commits branch)))) (insert ?\n) (magit-make-margin-overlay))) @@ -643,8 +641,7 @@ line is inserted at all." (magit-insert-section (shelved-branch ref t) (magit-insert-heading " " (magit--propertize-face (substring ref 13) 'magit-refname)) - (when (magit-buffer-margin-p) - (magit-refs--format-margin ref)) + (magit-refs--maybe-format-margin ref) (magit-refs--insert-cherry-commits ref))) (insert ?\n) (magit-make-margin-overlay)))) @@ -799,10 +796,11 @@ line is inserted at all." (message "No cherries for %s" ref) (magit-make-margin-overlay))))) -(defun magit-refs--format-margin (rev) - (if-let ((line (magit-rev-format "%cN%x00%ct" rev))) - (apply #'magit-log-format-margin rev (split-string line "\0")) - (magit-make-margin-overlay))) +(defun magit-refs--maybe-format-margin (rev) + (when (magit-buffer-margin-p) + (if-let ((line (magit-rev-format "%cN%x00%ct" rev))) + (apply #'magit-log-format-margin rev (split-string line "\0")) + (magit-make-margin-overlay)))) ;;; _ (provide 'magit-refs)