mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
ime: expand cursor cell-end across multi-cell characters
This fixes an issue where the cursor ended in the middle of e.g double width characters.
This commit is contained in:
parent
001c82fa54
commit
5c17b7f8e7
1 changed files with 7 additions and 0 deletions
7
ime.c
7
ime.c
|
|
@ -290,6 +290,13 @@ done(void *data, struct zwp_text_input_v3 *zwp_text_input_v3,
|
|||
}
|
||||
#endif
|
||||
|
||||
/* Expand cursor end to end of glyph */
|
||||
while (cell_end > cell_begin && cell_end < cell_count &&
|
||||
term->ime.preedit.cells[cell_end].wc == CELL_MULT_COL_SPACER)
|
||||
{
|
||||
cell_end++;
|
||||
}
|
||||
|
||||
LOG_DBG("pre-edit cursor: begin=%d, end=%d", cell_begin, cell_end);
|
||||
|
||||
assert(cell_begin >= 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue