diff options
-rw-r--r-- | spotify-widget/spotify.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spotify-widget/spotify.lua b/spotify-widget/spotify.lua index bd2309f..0eb302a 100644 --- a/spotify-widget/spotify.lua +++ b/spotify-widget/spotify.lua @@ -16,8 +16,8 @@ local GET_SPOTIFY_STATUS_CMD = 'sp status' local GET_CURRENT_SONG_CMD = 'sp current' local function ellipsize(text, length) - return (text:len() > length and length > 0) - and text:sub(0, length - 3) .. '...' + return (utf8.len(text) > length and length > 0) + and text:sub(0, utf8.offset(text, length - 2) - 1) .. '...' or text end |