render: ime: adjust cursor cell index when adjusting glyph offset

This commit is contained in:
Daniel Eklöf 2020-12-06 12:24:45 +01:00
parent d46dcd8ef5
commit bcfc468fd0
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -2219,9 +2219,12 @@ render_search_box(struct terminal *term)
}
/* Move offset if there is free space available */
if (total_cells - glyph_offset < visible_cells)
if (total_cells - glyph_offset < visible_cells) {
ssize_t old = glyph_offset;
term->render.search_glyph_offset = glyph_offset =
total_cells - min(total_cells, visible_cells);
cursor_cell_idx += old - (ssize_t)glyph_offset;
}
/*
* Render the search string, starting at glyph_offset. Note that