aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-02-04 19:55:08 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-02-07 15:33:32 +0000
commit93181649b32249f572bc4c6892c99155186fc714 (patch)
treeac301af02c3aa4482c7b4ffe4c5c4c4f318ba832 /input.c
parentconfig: show-urls-launch: change default key binding to ctrl+shift+u (diff)
config: add show-urls-copy action
This works just like show-urls-launch, except that instead of opening the URL (typically using xdg-open), it is placed in the clipboard when activated.
Diffstat (limited to 'input.c')
-rw-r--r--input.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/input.c b/input.c
index dfbf4fa3..65670aa3 100644
--- a/input.c
+++ b/input.c
@@ -272,12 +272,18 @@ execute_binding(struct seat *seat, struct terminal *term,
return true;
}
- case BIND_ACTION_SHOW_URLS_LAUNCH:
+ case BIND_ACTION_SHOW_URLS_COPY:
+ case BIND_ACTION_SHOW_URLS_LAUNCH: {
xassert(!urls_mode_is_active(term));
- urls_collect(term);
+ enum url_action url_action = action == BIND_ACTION_SHOW_URLS_COPY
+ ? URL_ACTION_COPY
+ : URL_ACTION_LAUNCH;
+
+ urls_collect(term, url_action);
render_refresh_urls(term);
return true;
+ }
case BIND_ACTION_SELECT_BEGIN:
selection_start(