1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-24 19:39:16 +02:00

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.
This commit is contained in:
Stefan Haller
2025-08-14 14:22:55 +02:00
parent 1e75aee37e
commit e54a8b2ee7

View File

@@ -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