1
0
Fork 0
mirror of https://github.com/Cloudef/bemenu synced 2024-06-13 04:56:47 +02:00

menu: fix delete on multi-byte characters

This commit is contained in:
Tuomas Siipola 2020-04-19 00:17:27 +03:00 committed by Jari Vetoniemi
parent 33cec5cff6
commit bdfc2aac84

View File

@ -710,8 +710,11 @@ bm_menu_run_with_key(struct bm_menu *menu, enum bm_key key, uint32_t unicode)
break;
case BM_KEY_DELETE:
if (menu->filter)
bm_utf8_rune_remove(menu->filter, menu->cursor + 1, NULL);
if (menu->filter) {
size_t width = bm_utf8_rune_next(menu->filter, menu->cursor);
if (width)
bm_utf8_rune_remove(menu->filter, menu->cursor + width, NULL);
}
break;
case BM_KEY_LINE_DELETE_LEFT: