Skip to content

Commit 389ff29

Browse files
authored
Fix right-alignment of divergence from base branch for branch checked out in a worktree (#4824)
- **PR Description** 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. I haven't used worktrees myself so far, so I didn't notice this before.
2 parents 1e75aee + e54a8b2 commit 389ff29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/gui/presentation/branches.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ func getBranchDisplayStrings(
7171
if showCommitHash {
7272
availableWidth -= utils.COMMIT_HASH_SHORT_SIZE + 1
7373
}
74+
paddingNeededForDivergence := availableWidth
75+
7476
if checkedOutByWorkTree {
7577
availableWidth -= utils.StringWidth(worktreeIcon) + 1
7678
}
77-
paddingNeededForDivergence := availableWidth
7879

7980
if len(branchStatus) > 0 {
8081
availableWidth -= utils.StringWidth(utils.Decolorise(branchStatus)) + 1

0 commit comments

Comments
 (0)