aboutsummaryrefslogtreecommitdiff
path: root/url-mode.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-02-14 13:18:11 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-02-21 19:15:31 +0000
commit06a9ffa7632abf201b0ea0270bb5058af4fc4a6b (patch)
tree7280dcfd13e641526278628bf663df830a81d848 /url-mode.c
parenturls: remove free-form ‘text’ member from URL struct (diff)
urls: add key binding that toggles whether URLs are displayed on jump-label
By default, the URL isn’t shown on the jump-label. For auto-detect URLs, doing so is virtually always useless, as the URL is already visible in the grid. For OSC-8 URLs however, the URL is often _not_ visible in the grid. Many times, seeing the URL is still not needed (if you’re doing ‘ls --hyperlink’, you already know what the URIs are). But it is still useful to have a way to show the URLs. This patch adds a new key binding action that can be used in url-mode to toggle the URL on and off in the jump label. It is bound to ctrl+t by default.
Diffstat (limited to 'url-mode.c')
-rw-r--r--url-mode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/url-mode.c b/url-mode.c
index 44f9bb19..09e170e6 100644
--- a/url-mode.c
+++ b/url-mode.c
@@ -30,6 +30,11 @@ execute_binding(struct seat *seat, struct terminal *term,
urls_reset(term);
return true;
+ case BIND_ACTION_URL_TOGGLE_URL_ON_JUMP_LABEL:
+ term->urls_show_uri_on_jump_label = !term->urls_show_uri_on_jump_label;
+ render_refresh_urls(term);
+ return true;
+
case BIND_ACTION_URL_COUNT:
return false;
@@ -613,6 +618,7 @@ urls_reset(struct terminal *term)
tll_remove(term->urls, it);
}
+ term->urls_show_uri_on_jump_label = false;
memset(term->url_keys, 0, sizeof(term->url_keys));
render_refresh(term);
}