From 65a8180b27882f574a1f481d7bcb2ab607027a36 Mon Sep 17 00:00:00 2001 From: Henry So Date: Thu, 20 Jan 2022 21:16:41 -0500 Subject: [PATCH] Fixed improper truncation in the middle of a Unicode codepoint (#61) --- widget_recent_window.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/widget_recent_window.go b/widget_recent_window.go index f8f0d3a..22388c6 100644 --- a/widget_recent_window.go +++ b/widget_recent_window.go @@ -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]) } }