aboutsummaryrefslogtreecommitdiff
path: root/search.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-02-09 16:52:37 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-02-09 16:52:37 +0000
commitee840a308aeb3a5ce00137da35dacebe2d9892ad (patch)
tree7b100acca663f7ff28f7c431e8c755610957000f /search.c
parentfoot.ini: add modeline so vim uses # comments instead of ; (diff)
parentconfig: rename csd.color.close -> quit (diff)
Merge branch 'refactor-key-bindings'
Diffstat (limited to 'search.c')
-rw-r--r--search.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/search.c b/search.c
index 8015f265..6251c697 100644
--- a/search.c
+++ b/search.c
@@ -604,10 +604,11 @@ from_clipboard_done(void *user)
static bool
execute_binding(struct seat *seat, struct terminal *term,
- enum bind_action_search action, uint32_t serial,
+ const struct key_binding *binding, uint32_t serial,
bool *update_search_result, bool *redraw)
{
*update_search_result = *redraw = false;
+ const enum bind_action_search action = binding->action;
switch (action) {
case BIND_ACTION_SEARCH_NONE:
@@ -838,10 +839,10 @@ search_input(struct seat *seat, struct terminal *term, uint32_t key,
const struct key_binding *bind = &it->item;
/* Match translated symbol */
- if (bind->sym == sym &&
+ if (bind->k.sym == sym &&
bind->mods == (mods & ~consumed)) {
- if (execute_binding(seat, term, bind->action, serial,
+ if (execute_binding(seat, term, bind, serial,
&update_search_result, &redraw))
{
goto update_search;
@@ -854,8 +855,8 @@ search_input(struct seat *seat, struct terminal *term, uint32_t key,
/* Match untranslated symbols */
for (size_t i = 0; i < raw_count; i++) {
- if (bind->sym == raw_syms[i]) {
- if (execute_binding(seat, term, bind->action, serial,
+ if (bind->k.sym == raw_syms[i]) {
+ if (execute_binding(seat, term, bind, serial,
&update_search_result, &redraw))
{
goto update_search;
@@ -865,9 +866,9 @@ search_input(struct seat *seat, struct terminal *term, uint32_t key,
}
/* Match raw key code */
- tll_foreach(bind->key_codes, code) {
+ tll_foreach(bind->k.key_codes, code) {
if (code->item == key) {
- if (execute_binding(seat, term, bind->action, serial,
+ if (execute_binding(seat, term, bind, serial,
&update_search_result, &redraw))
{
goto update_search;