mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-06 01:40:22 -05:00
ime: render pre-edit text
This is done by allocating cells for the pre-edit text when receiving the text-input::done() call, and populating them by converting the utf-8 formatted pre-edit text to wchars. We also convert the pre-edit cursor position to cell positions (it can cover multiple cells). When rendering, we simply render the pre-edit cells on-top off the regular grid. While doing so, we also mark the underlying, “real”, cells as dirty, to ensure they are re-rendered when the pre-edit text is modified or removed.
This commit is contained in:
parent
5745c610ac
commit
8c3d48c5cd
8 changed files with 364 additions and 60 deletions
13
terminal.h
13
terminal.h
|
|
@ -470,6 +470,19 @@ struct terminal {
|
|||
unsigned max_height; /* Maximum image height, in pixels */
|
||||
} sixel;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
struct cell *cells;
|
||||
int count;
|
||||
|
||||
struct {
|
||||
bool hidden;
|
||||
int start; /* Cell index, inclusive */
|
||||
int end; /* Cell index, exclusive */
|
||||
} cursor;
|
||||
} preedit;
|
||||
} ime;
|
||||
|
||||
bool quit;
|
||||
bool is_shutting_down;
|
||||
void (*shutdown_cb)(void *data, int exit_code);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue