From 2cc84db97978388475504592c88911046bcd2eb6 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 31 Jan 2021 11:12:07 +0100 Subject: urls: initial support for detecting URLs and rendering jump-labels The jump labels work, but is currently hardcoded to use xdg-open --- input.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'input.c') 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 -- cgit v1.3