aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-06-23 23:26:57 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-06-26 16:39:24 +0000
commit48cf57818d354625fd1820ee82e31b8bb3227202 (patch)
treec428827a11792cc33ca144c8c2588355db9cb55c /terminal.h
parentterm: term_fill(): only set OSC-8 + styled hyperlinks when use_sgr_attrs is set (diff)
term: performance: use a bitfield to track which ascii printer to use
The things affecting which ASCII printer we use have grown... Instead of checking everything inside term_update_ascii_printer(), use a bitfield. Anything affecting the printer used, must now set a bit in this bitfield. This makes term_update_ascii_printer() much faster, since all it needs to do is check if the bitfield is zero or not.
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/terminal.h b/terminal.h
index 7f6814d3..9fdd3dc0 100644
--- a/terminal.h
+++ b/terminal.h
@@ -393,6 +393,17 @@ struct terminal {
const struct config *conf;
void (*ascii_printer)(struct terminal *term, char32_t c);
+ union {
+ struct {
+ bool sixels:1;
+ bool osc8:1;
+ bool curly_style:1;
+ bool curly_color:1;
+ bool insert_mode:1;
+ bool charset:1;
+ };
+ uint8_t value;
+ } bits_affecting_ascii_printer;
pid_t slave;
int ptmx;