diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2024-12-30 00:57:06 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2024-12-30 00:57:55 +0100 |
commit | 9b274417c5732dccd02f342f4f112addc02a5e37 (patch) | |
tree | 74e6b345474fe67d8a79461ffd953a24f123b291 /sdn.cpp | |
parent | cc14a9f735f513fe5e0b4cd1f7552b5573b3d4ec (diff) | |
download | sdn-9b274417c5732dccd02f342f4f112addc02a5e37.tar.gz sdn-9b274417c5732dccd02f342f4f112addc02a5e37.tar.xz sdn-9b274417c5732dccd02f342f4f112addc02a5e37.zip |
Make pressing / in search activate ACTION_ENTER
You can disable this in the bindings file using: search / none
Closes #6
Diffstat (limited to 'sdn.cpp')
-rw-r--r-- | sdn.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |