mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-08 10:06:22 -05:00
render: search: handle multi-column characters
This commit is contained in:
parent
dca35215d0
commit
a552610fdb
1 changed files with 3 additions and 2 deletions
5
render.c
5
render.c
|
|
@ -2117,7 +2117,8 @@ render_search_box(struct terminal *term)
|
|||
{
|
||||
assert(term->window->search_sub_surface != NULL);
|
||||
|
||||
const size_t wanted_visible_chars = max(20, term->search.len);
|
||||
const size_t wanted_visible_chars = max(
|
||||
20, wcsnlen(term->search.buf, term->search.len));
|
||||
|
||||
assert(term->scale >= 1);
|
||||
const int scale = term->scale;
|
||||
|
|
@ -2199,7 +2200,7 @@ render_search_box(struct terminal *term)
|
|||
pixman_image_unref(src);
|
||||
}
|
||||
|
||||
x += term->cell_width;
|
||||
x += max(1, wcwidth(term->search.buf[i])) * term->cell_width;
|
||||
}
|
||||
|
||||
if (term->search.cursor >= term->search.len)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue