From e54a8b2ee788fea6a99a2df2f125da7d70ddc46f Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 14 Aug 2025 14:22:55 +0200 Subject: [PATCH] Fix right-alignment of divergence from base branch for branch checked out in a worktree We didn't take the worktree icon into account properly, so the divergence indication was offset to the left by two characters in this case. --- pkg/gui/presentation/branches.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/gui/presentation/branches.go b/pkg/gui/presentation/branches.go index 79966ebc8..012059f8b 100644 --- a/pkg/gui/presentation/branches.go +++ b/pkg/gui/presentation/branches.go @@ -71,10 +71,11 @@ func getBranchDisplayStrings( if showCommitHash { availableWidth -= utils.COMMIT_HASH_SHORT_SIZE + 1 } + paddingNeededForDivergence := availableWidth + if checkedOutByWorkTree { availableWidth -= utils.StringWidth(worktreeIcon) + 1 } - paddingNeededForDivergence := availableWidth if len(branchStatus) > 0 { availableWidth -= utils.StringWidth(utils.Decolorise(branchStatus)) + 1