mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
Fix truncation of long branch names containing non-ASCII characters
This commit is contained in:
@ -79,10 +79,10 @@ func getBranchDisplayStrings(
|
||||
}
|
||||
|
||||
// Don't bother shortening branch names that are already 3 characters or less
|
||||
if len(displayName) > max(availableWidth, 3) {
|
||||
if runewidth.StringWidth(displayName) > max(availableWidth, 3) {
|
||||
// Never shorten the branch name to less then 3 characters
|
||||
len := max(availableWidth, 4)
|
||||
displayName = displayName[:len-1] + "…"
|
||||
displayName = runewidth.Truncate(displayName, len, "…")
|
||||
}
|
||||
coloredName := nameTextStyle.Sprint(displayName)
|
||||
if checkedOutByWorkTree {
|
||||
|
Reference in New Issue
Block a user