From 80dd276b78a13e30b38d16dd6ea64467fbaeb441 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 23 Sep 2024 14:19:39 +0200 Subject: [PATCH] dialogs/TextInputDialog: forward KEY_{RETURN,LINEFEED} to caller in "fragile" mode This reverts to the behavior prior to a8f90d32c3e54383cb3a27bce7103e9b85b1b27b when we switched the "jump" command to TextInputDialog. --- NEWS | 1 + src/dialogs/TextInputDialog.cxx | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/NEWS b/NEWS index 5bd6be09..bd287316 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ ncmpc 0.51 - not yet released * repaint main area after terminal was resized +* pressing Enter while in "jump mode" activates selected item ncmpc 0.50 - (2024-09-12) * build: require Meson 0.60 diff --git a/src/dialogs/TextInputDialog.cxx b/src/dialogs/TextInputDialog.cxx index 49ddcb88..6e4a0602 100644 --- a/src/dialogs/TextInputDialog.cxx +++ b/src/dialogs/TextInputDialog.cxx @@ -219,6 +219,11 @@ bool TextInputDialog::OnKey(const Window window, int key) { if (key == KEY_RETURN || key == KEY_LINEFEED) { + if (fragile) { + Cancel(); + return false; + } + SetReady(); return true; }