Make pressing / in search activate ACTION_ENTER
All checks were successful
Alpine 3.20 Success
Arch Linux AUR Success
OpenBSD 7.5 Success

You can disable this in the bindings file using: search / none

Closes #6
This commit is contained in:
Přemysl Eric Janouch 2024-12-30 00:57:06 +01:00
parent cc14a9f735
commit 9b274417c5
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -499,6 +499,7 @@ static map<wint_t, action> g_input_actions {
static map<wint_t, action> g_search_actions {
{CTRL ('P'), ACTION_UP}, {KEY (UP), ACTION_UP},
{CTRL ('N'), ACTION_DOWN}, {KEY (DOWN), ACTION_DOWN},
{'/', ACTION_ENTER},
};
static const map<string, map<wint_t, action>*> g_binding_contexts {
{"normal", &g_normal_actions}, {"input", &g_input_actions},
@ -1644,6 +1645,11 @@ fun handle (wint_t c) -> bool {
g.editor_on[ACTION_UP] = [] { match_interactive (-1); };
g.editor_on[ACTION_DOWN] = [] { match_interactive (+1); };
g.editor_on[ACTION_INPUT_CONFIRM] = [] { enter (at_cursor ()); };
g.editor_on[ACTION_ENTER] = [] {
enter (at_cursor ());
g.editor_line.clear ();
g.editor_cursor = 0;
};
break;
case ACTION_RENAME_PREFILL:
g.editor_line = to_wide (current.filename);