mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-29 22:48:24 +02:00
Fix multibyte initial characters
This commit is contained in:
committed by
Jesse Duffield
parent
253504a094
commit
6171690b00
@@ -146,8 +146,12 @@ func Reverse(values []string) []string {
|
||||
}
|
||||
|
||||
func LimitStr(value string, limit int) string {
|
||||
if len(value) > limit {
|
||||
return value[:limit]
|
||||
n := 0
|
||||
for i := range value {
|
||||
if n >= limit {
|
||||
return value[:i]
|
||||
}
|
||||
n++
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user