mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-30 06:46:45 -04:00
term: cache currently selected charset
vt.c::action_print(), which is in the hot path, needs to lookup the currently selected charset. This currently requires two loads; first to load the current charset *index*, and then another to get _which_ charset is currently mapped to that index. By caching the current charset, we only need one load. We need to update the cache when: * A different charset index is selected (i.e. SO/SI) * The charset for the current index is changed (e.g. ‘\E(0’, ‘\E(B’ etc) * We restore saved charsets
This commit is contained in:
parent
c5c3447ca8
commit
aa8902a6ef
3 changed files with 12 additions and 6 deletions
|
|
@ -2335,6 +2335,7 @@ term_restore_cursor(struct terminal *term, const struct cursor *cursor)
|
|||
|
||||
term->vt.attrs = term->vt.saved_attrs;
|
||||
term->charsets = term->saved_charsets;
|
||||
term->charset = term->charsets.set[term->charsets.selected];
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue