search: re-enable search-commit action

This was disabled while implementing multi-seat support, and I forgot
to fix and re-enable before that feature was merged.
This commit is contained in:
Daniel Eklöf 2020-07-22 17:51:27 +02:00
parent 2092185d29
commit ac7b229f7c
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -412,8 +412,8 @@ distance_prev_word(const struct terminal *term)
} }
static bool static bool
execute_binding(struct terminal *term, enum bind_action_search action, execute_binding(struct seat *seat, struct terminal *term,
uint32_t serial) enum bind_action_search action, uint32_t serial)
{ {
switch (action) { switch (action) {
case BIND_ACTION_SEARCH_NONE: case BIND_ACTION_SEARCH_NONE:
@ -429,10 +429,8 @@ execute_binding(struct terminal *term, enum bind_action_search action,
return true; return true;
case BIND_ACTION_SEARCH_COMMIT: case BIND_ACTION_SEARCH_COMMIT:
#if 0 selection_finalize(seat, term, serial);
selection_finalize(term, term->wl->input_serial);
search_cancel_keep_selection(term); search_cancel_keep_selection(term);
#endif
return true; return true;
case BIND_ACTION_SEARCH_FIND_PREV: case BIND_ACTION_SEARCH_FIND_PREV:
@ -584,7 +582,7 @@ search_input(struct seat *seat, struct terminal *term, uint32_t key,
/* Match symbol */ /* Match symbol */
if (it->item.bind.sym == sym) { if (it->item.bind.sym == sym) {
if (!execute_binding(term, it->item.action, serial)) if (!execute_binding(seat, term, it->item.action, serial))
goto update_search; goto update_search;
return; return;
} }
@ -592,7 +590,7 @@ search_input(struct seat *seat, struct terminal *term, uint32_t key,
/* Match raw key code */ /* Match raw key code */
tll_foreach(it->item.bind.key_codes, code) { tll_foreach(it->item.bind.key_codes, code) {
if (code->item == key) { if (code->item == key) {
if (!execute_binding(term, it->item.action, serial)) if (!execute_binding(seat, term, it->item.action, serial))
goto update_search; goto update_search;
return; return;
} }