Skip to content

Commit

Permalink
{Help,Song}Page: call FindSupport::Find() as coroutine
Browse files Browse the repository at this point in the history
The method was converted to a coroutine by commit
dc0ed2f, but the HelpPage caller was
not adjusted, breaking searching on the help and song page.

Closes #154
  • Loading branch information
MaxKellermann committed Jan 1, 2025
1 parent d78f647 commit 2114449
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ncmpc 0.52 - not yet released
* fix searching on Help and Song page

ncmpc 0.51 - (2024-09-23)
* repaint main area after terminal was resized
Expand Down
11 changes: 9 additions & 2 deletions src/HelpPage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,16 @@ HelpPage::OnCommand(struct mpdclient &c, Command cmd)
search */
lw.SetCursorFromOrigin(0);

if (screen.find_support.Find(lw, *this, cmd)) {
SchedulePaint();
switch (cmd) {
case Command::LIST_FIND:
case Command::LIST_RFIND:
case Command::LIST_FIND_NEXT:
case Command::LIST_RFIND_NEXT:
CoStart(screen.find_support.Find(lw, *this, cmd));
return true;

default:
break;
}

return false;
Expand Down
11 changes: 9 additions & 2 deletions src/SongPage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,16 @@ SongPage::OnCommand(struct mpdclient &c, Command cmd)
if (ListPage::OnCommand(c, cmd))
return true;

if (screen.find_support.Find(lw, *this, cmd)) {
SchedulePaint();
switch (cmd) {
case Command::LIST_FIND:
case Command::LIST_RFIND:
case Command::LIST_FIND_NEXT:
case Command::LIST_RFIND_NEXT:
CoStart(screen.find_support.Find(lw, *this, cmd));
return true;

default:
break;
}

return false;
Expand Down

0 comments on commit 2114449

Please sign in to comment.