Skip to content

Commit

Permalink
SongRowPaint: use the strfsong() return value
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Sep 1, 2024
1 parent 6bced0c commit 939a0c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/SongRowPaint.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ paint_song_row(const Window window, [[maybe_unused]] int y, unsigned width,
{
char buffer[1024];

strfsong(buffer, format, song);
const std::string_view text = strfsong(buffer, format, song);
row_paint_text(window, width, highlight ? Style::LIST_BOLD : Style::LIST,
selected, buffer);
selected, text);

#ifndef NCMPC_MINI
if (options.second_column && mpd_song_get_duration(song) > 0) {
Expand All @@ -36,8 +36,8 @@ paint_song_row(const Window window, [[maybe_unused]] int y, unsigned width,
}

if (hscroll != nullptr && width > 3 &&
StringWidthMB(buffer) >= width) {
hscroll->Set({0, y}, width, buffer,
StringWidthMB(text) >= width) {
hscroll->Set({0, y}, width, text,
highlight ? Style::LIST_BOLD : Style::LIST,
selected ? A_REVERSE : 0);
hscroll->Paint();
Expand Down

0 comments on commit 939a0c4

Please sign in to comment.