url-mode: input: backspace reverts the last key

This commit is contained in:
Daniel Eklöf 2021-02-07 10:32:56 +01:00
parent ddd6f1d944
commit 1aec534b37
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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);
/*
@ -106,8 +117,6 @@ urls_input(struct seat *seat, struct terminal *term, uint32_t key,
* sequence.
*/
size_t seq_len = wcslen(term->url_keys);
bool is_valid = false;
const struct url *match = NULL;