mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-15 04:27:52 -05:00
render: search: glyph_offset is in *cells*, cursor position in *characters*
When calculating the offset into the search string, from where to start rendering, take into account that the cursor position is in *characters*, and the glyph-offset is in *cells*.
This commit is contained in:
parent
5ffa65a2e3
commit
b4a0f5b13b
2 changed files with 70 additions and 18 deletions
6
search.c
6
search.c
|
|
@ -18,6 +18,7 @@
|
|||
#include "selection.h"
|
||||
#include "shm.h"
|
||||
#include "util.h"
|
||||
#include "xmalloc.h"
|
||||
|
||||
/*
|
||||
* Ensures a "new" viewport doesn't contain any unallocated rows.
|
||||
|
|
@ -124,6 +125,11 @@ search_begin(struct terminal *term)
|
|||
term->search.view_followed_offset = term->grid->view == term->grid->offset;
|
||||
term->is_searching = true;
|
||||
|
||||
term->search.len = 0;
|
||||
term->search.sz = 64;
|
||||
term->search.buf = xmalloc(term->search.sz * sizeof(term->search.buf[0]));
|
||||
term->search.buf[0] = L'\0';
|
||||
|
||||
term_xcursor_update(term);
|
||||
render_refresh_search(term);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue