File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -164,12 +164,12 @@ func (m model) BaseView() string {
164164 )
165165}
166166
167- func truncate (s string , w int ) string {
168- if w <= 1 {
167+ func truncate (s string , width int ) string {
168+ if width <= 1 {
169169 return ""
170170 }
171- if len (s ) > w {
172- return s [:w - 1 ] + "…"
171+ if len (s ) > width {
172+ return s [:width - 1 ] + "…"
173173 }
174174 return s
175175}
@@ -648,9 +648,11 @@ func footerInformation(m model, width int) string {
648648 if topRowGap < 0 {
649649 topRowGap = 0
650650 }
651+
652+ truncatedTitle := truncate (songTitle , width - runewidth .StringWidth (notifcationStatus ))
651653 topRow = lipgloss .JoinHorizontal (
652654 lipgloss .Center ,
653- lipgloss .NewStyle ().Foreground (Theme .Highlight ).Render (songTitle ),
655+ lipgloss .NewStyle ().Foreground (Theme .Highlight ).Render (truncatedTitle ),
654656 strings .Repeat (" " , topRowGap ),
655657 notifcationStatus ,
656658 )
@@ -685,9 +687,11 @@ func footerInformation(m model, width int) string {
685687 if middleRowGap < 0 {
686688 middleRowGap = 0
687689 }
690+
691+ truncatedSongAlbumArtistInfo := truncate (songAlbumArtistInfo , width - runewidth .StringWidth (loopStatus )- 1 - runewidth .StringWidth (volumeStatus ))
688692 middleRow = lipgloss .JoinHorizontal (
689693 lipgloss .Center ,
690- songAlbumArtistInfo ,
694+ truncatedSongAlbumArtistInfo ,
691695 strings .Repeat (" " , middleRowGap ),
692696 loopStatus ,
693697 " " ,
You can’t perform that action at this time.
0 commit comments