mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-14 05:33:59 -04:00
url-mode: add a key binding that enables “persistent” URL mode
This is an alternative to ‘show-urls-launch’, where we stay in URL mode after activating an URL. Closes #964
This commit is contained in:
parent
0062f4e133
commit
501a9fbb5e
8 changed files with 37 additions and 11 deletions
16
url-mode.c
16
url-mode.c
|
|
@ -84,7 +84,8 @@ activate_url(struct seat *seat, struct terminal *term, const struct url *url)
|
|||
}
|
||||
break;
|
||||
|
||||
case URL_ACTION_LAUNCH: {
|
||||
case URL_ACTION_LAUNCH:
|
||||
case URL_ACTION_PERSISTENT: {
|
||||
size_t argc;
|
||||
char **argv;
|
||||
|
||||
|
|
@ -205,7 +206,18 @@ urls_input(struct seat *seat, struct terminal *term, uint32_t key,
|
|||
|
||||
if (match) {
|
||||
activate_url(seat, term, match);
|
||||
urls_reset(term);
|
||||
|
||||
switch (match->action) {
|
||||
case URL_ACTION_COPY:
|
||||
case URL_ACTION_LAUNCH:
|
||||
urls_reset(term);
|
||||
break;
|
||||
|
||||
case URL_ACTION_PERSISTENT:
|
||||
term->url_keys[0] = U'\0';
|
||||
render_refresh_urls(term);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else if (is_valid) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue