diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-12-03 17:41:42 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-12-07 19:44:11 +0000 |
| commit | 5c17b7f8e77f96622d558ccbd5071706863c2816 (patch) | |
| tree | b7b7de7a3e86718d9eeaa7cd15588f7feccadfdb | |
| parent | ime: don’t adjust cursor’s cell-end if it’s equal to the cell-begin (diff) | |
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.
| -rw-r--r-- | ime.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); |
