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
|
|
@ -280,6 +280,7 @@ struct terminal {
|
|||
|
||||
struct charsets charsets;
|
||||
struct charsets saved_charsets; /* For save/restore cursor + attributes */
|
||||
enum charset charset; /* cached copy of charsets.set[charsets.selected] */
|
||||
|
||||
bool auto_margin;
|
||||
bool insert_mode;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue