mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-31 07:11:09 -04:00
url-mode: input: backspace reverts the last key
This commit is contained in:
parent
ddd6f1d944
commit
1aec534b37
1 changed files with 11 additions and 2 deletions
13
url-mode.c
13
url-mode.c
|
|
@ -98,6 +98,17 @@ urls_input(struct seat *seat, struct terminal *term, uint32_t key,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t seq_len = wcslen(term->url_keys);
|
||||||
|
|
||||||
|
if (sym == XKB_KEY_BackSpace) {
|
||||||
|
if (seq_len > 0) {
|
||||||
|
term->url_keys[seq_len - 1] = L'\0';
|
||||||
|
render_refresh_urls(term);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
wchar_t wc = xkb_state_key_get_utf32(seat->kbd.xkb_state, key);
|
wchar_t wc = xkb_state_key_get_utf32(seat->kbd.xkb_state, key);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -106,8 +117,6 @@ urls_input(struct seat *seat, struct terminal *term, uint32_t key,
|
||||||
* sequence.
|
* sequence.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
size_t seq_len = wcslen(term->url_keys);
|
|
||||||
|
|
||||||
bool is_valid = false;
|
bool is_valid = false;
|
||||||
const struct url *match = NULL;
|
const struct url *match = NULL;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue