aboutsummaryrefslogtreecommitdiff
path: root/url-mode.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 /url-mode.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 'url-mode.c')
-rw-r--r--url-mode.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/url-mode.c b/url-mode.c
index 82002fa0..350bdf25 100644
--- a/url-mode.c
+++ b/url-mode.c
@@ -25,8 +25,10 @@ static void url_destroy(struct url *url);
static bool
execute_binding(struct seat *seat, struct terminal *term,
- enum bind_action_url action, uint32_t serial)
+ const struct key_binding *binding, uint32_t serial)
{
+ const enum bind_action_url action = binding->action;
+
switch (action) {
case BIND_ACTION_URL_NONE:
return false;
@@ -125,10 +127,10 @@ urls_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))
{
- execute_binding(seat, term, bind->action, serial);
+ execute_binding(seat, term, bind, serial);
return;
}
@@ -136,16 +138,16 @@ urls_input(struct seat *seat, struct terminal *term, uint32_t key,
continue;
for (size_t i = 0; i < raw_count; i++) {
- if (bind->sym == raw_syms[i]) {
- execute_binding(seat, term, bind->action, serial);
+ if (bind->k.sym == raw_syms[i]) {
+ execute_binding(seat, term, bind, serial);
return;
}
}
/* Match raw key code */
- tll_foreach(bind->key_codes, code) {
+ tll_foreach(bind->k.key_codes, code) {
if (code->item == key) {
- execute_binding(seat, term, bind->action, serial);
+ execute_binding(seat, term, bind, serial);
return;
}
}