Skip to content

Commit

Permalink
cut text if too big
Browse files Browse the repository at this point in the history
  • Loading branch information
FKD13 committed Mar 2, 2024
1 parent 7b9fa33 commit 0b2b809
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions screen/spotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ func (spotify *Spotify) Run() {
spotify.mu.Lock()

if len(spotify.buffer) != w {
if len(spotify.text) > w {
spotify.text = spotify.text[0 : w-4]
spotify.text += "..."
}
spotify.buffer = spotify.text + strings.Repeat(" ", w-len(spotify.text))
}

Expand Down

0 comments on commit 0b2b809

Please sign in to comment.