aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-03-16 11:57:25 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-03-16 11:57:25 +0000
commitb601307faeb47374485e5990db5177556bce7715 (patch)
treebc17b41724788b473afa8b341b0ebfc18999f4cf
parentterm: runtime switch between a ‘fast’ and a ‘generic’ ASCII print function (diff)
term: update_ascii_printer(): log when we (actually) switch printer
-rw-r--r--terminal.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/terminal.c b/terminal.c
index 0fe53ac1..68a7a138 100644
--- a/terminal.c
+++ b/terminal.c
@@ -2911,12 +2911,22 @@ ascii_printer_fast(struct terminal *term, wchar_t wc)
void
term_update_ascii_printer(struct terminal *term)
{
- term->ascii_printer =
+ void (*new_printer)(struct terminal *term, wchar_t wc) =
unlikely(tll_length(term->grid->sixel_images) > 0 ||
term->charsets.set[term->charsets.selected] == CHARSET_GRAPHIC ||
term->insert_mode)
? &ascii_printer_generic
: &ascii_printer_fast;
+
+#if defined(_DEBUG) && LOG_ENABLE_DBG
+ if (term->ascii_printer != new_printer) {
+ LOG_DBG("switching ASCII printer %s -> %s",
+ term->ascii_printer == &ascii_printer_fast ? "fast" : "generic",
+ new_printer == &ascii_printer_fast ? "fast" : "generic");
+ }
+#endif
+
+ term->ascii_printer = new_printer;
}
enum term_surface