Skip to content

Commit

Permalink
Fixed improper truncation in the middle of a Unicode codepoint (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryso authored Jan 21, 2022
1 parent 2a212f3 commit 65a8180
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions widget_recent_window.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ func (w *RecentWindowWidget) Update() error {
var name string
if w.showTitle {
name = recentWindows[w.window].Name
if len(name) > 10 {
name = name[:10]
runes := []rune(name)
if len(runes) > 10 {
name = string(runes[:10])
}
}

Expand Down

0 comments on commit 65a8180

Please sign in to comment.