aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-31 10:12:07 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-02-07 15:33:31 +0000
commit2cc84db97978388475504592c88911046bcd2eb6 (patch)
tree91efd350b53a6b296c0e78eb5781ef0e59cdddbf /input.c
parentconfig: free URL bindings (diff)
urls: initial support for detecting URLs and rendering jump-labels
The jump labels work, but is currently hardcoded to use xdg-open
Diffstat (limited to 'input.c')
-rw-r--r--input.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/input.c b/input.c
index 892b7f32..9dbdaad1 100644
--- a/input.c
+++ b/input.c
@@ -34,6 +34,7 @@
#include "spawn.h"
#include "terminal.h"
#include "tokenize.h"
+#include "url-mode.h"
#include "util.h"
#include "vt.h"
#include "xmalloc.h"
@@ -272,8 +273,11 @@ execute_binding(struct seat *seat, struct terminal *term,
}
case BIND_ACTION_SHOW_URLS:
- assert(false);
- break;
+ xassert(!urls_mode_is_active(term));
+
+ urls_collect(term);
+ render_refresh_urls(term);
+ return true;
case BIND_ACTION_SELECT_BEGIN:
selection_start(
@@ -854,6 +858,11 @@ key_press_release(struct seat *seat, struct terminal *term, uint32_t serial,
start_repeater(seat, key);
search_input(seat, term, key, sym, effective_mods, serial);
return;
+ } else if (urls_mode_is_active(term)) {
+ if (should_repeat)
+ start_repeater(seat, key);
+ urls_input(seat, term, key, sym, effective_mods, serial);
+ return;
}
#if 0