From 211444954bad836dc7bddf3885e099009825a3a6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 1 Jan 2025 13:30:02 +0100 Subject: [PATCH] {Help,Song}Page: call FindSupport::Find() as coroutine The method was converted to a coroutine by commit dc0ed2fce47812e0747d1bc03a614543943c7430, but the HelpPage caller was not adjusted, breaking searching on the help and song page. Closes https://github.com/MusicPlayerDaemon/ncmpc/issues/154 --- NEWS | 1 + src/HelpPage.cxx | 11 +++++++++-- src/SongPage.cxx | 11 +++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 7b478569..6fbb05ad 100644 --- a/NEWS +++ b/NEWS @@ -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 diff --git a/src/HelpPage.cxx b/src/HelpPage.cxx index 77003649..73dfe8dc 100644 --- a/src/HelpPage.cxx +++ b/src/HelpPage.cxx @@ -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; diff --git a/src/SongPage.cxx b/src/SongPage.cxx index b5b286bd..fb3bb291 100644 --- a/src/SongPage.cxx +++ b/src/SongPage.cxx @@ -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;