diff --git a/src/HelpPage.cxx b/src/HelpPage.cxx index bc49ea19..1d8aaf72 100644 --- a/src/HelpPage.cxx +++ b/src/HelpPage.cxx @@ -317,7 +317,13 @@ HelpPage::OnCommand(struct mpdclient &c, Command cmd) if (ListPage::OnCommand(c, cmd)) return true; - lw.SetCursorFromOrigin(0); + if (!lw.IsCursorVisible()) + /* start searching at the beginning of the page (not + where the invisible cursor just happens to be), + unless the cursor is still visible from the last + search */ + lw.SetCursorFromOrigin(0); + if (screen_find(screen, lw, cmd, *this)) { SetDirty(); return true; diff --git a/src/TextPage.cxx b/src/TextPage.cxx index 78a41380..8156f132 100644 --- a/src/TextPage.cxx +++ b/src/TextPage.cxx @@ -88,7 +88,13 @@ TextPage::OnCommand(struct mpdclient &c, Command cmd) if (ListPage::OnCommand(c, cmd)) return true; - lw.SetCursorFromOrigin(0); + if (!lw.IsCursorVisible()) + /* start searching at the beginning of the page (not + where the invisible cursor just happens to be), + unless the cursor is still visible from the last + search */ + lw.SetCursorFromOrigin(0); + if (screen_find(screen, lw, cmd, *this)) { SetDirty(); return true;