port fixes from foot/master

This commit is contained in:
Piotr Kocia 2025-12-02 10:56:21 +01:00
parent eba65d430e
commit 2b17abff3d

View file

@ -502,8 +502,17 @@ static ssize_t matches_cell(const struct terminal *term,
if (composed == NULL && base == 0 && buf[search_ofs] == U' ') if (composed == NULL && base == 0 && buf[search_ofs] == U' ')
return 1; return 1;
if (c32ncasecmp(&base, buf, 1) != 0) // Search is case sensitive if the search buffer contains any
// uppercase characters.
if (hasc32upper(buf)) {
if (c32ncmp(&base, buf + search_ofs, 1) != 0) {
return -1; return -1;
}
} else {
if (c32ncasecmp(&base, buf + search_ofs, 1) != 0) {
return -1;
}
}
if (composed != NULL) { if (composed != NULL) {
if (search_ofs + composed->count > len) if (search_ofs + composed->count > len)
@ -1737,7 +1746,8 @@ void vimode_input(struct seat *seat, struct terminal *term,
count = xkb_compose_state_get_utf8(seat->kbd.xkb_compose_state, count = xkb_compose_state_get_utf8(seat->kbd.xkb_compose_state,
(char *)buf, sizeof(buf)); (char *)buf, sizeof(buf));
xkb_compose_state_reset(seat->kbd.xkb_compose_state); xkb_compose_state_reset(seat->kbd.xkb_compose_state);
} else if (compose_status == XKB_COMPOSE_CANCELLED) { } else if (compose_status == XKB_COMPOSE_CANCELLED ||
compose_status == XKB_COMPOSE_COMPOSING) {
count = 0; count = 0;
} else { } else {
count = xkb_state_key_get_utf8(seat->kbd.xkb_state, key, count = xkb_state_key_get_utf8(seat->kbd.xkb_state, key,