Commit: 328435e68e92bf6f78d3f1ae67c97a1a4a65d02a
Parent: 44781c6461d5fa4a1c9868215d3472b4018e9d98
Author: Randy Palamar
Date: Wed, 14 Aug 2024 06:38:51 -0600
debug: include cursor position in line dump
Diffstat:
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/debug.c b/debug.c
@@ -32,23 +32,26 @@ simulate_line(Term *t, Line *line)
}
static void
-fput_cursor_info(FILE *f, CellStyle c)
+fput_cursor_info(FILE *f, Cursor c)
{
- fprintf(f, "\tFG: 0x%08x\n", c.fg.rgba);
- fprintf(f, "\tBG: 0x%08x\n", c.bg.rgba);
- fprintf(f, "\tAttr: 0x%08x\n", c.attr);
+ fprintf(f, "\tFG: 0x%08x\n", c.state.fg.rgba);
+ fprintf(f, "\tBG: 0x%08x\n", c.state.bg.rgba);
+ fprintf(f, "\tAttr: 0x%08x\n", c.state.attr);
+ fprintf(f, "\tPos: {%d, %d}\n", c.row, c.col);
}
static void
fput_line_info(FILE *f, Term *t, Line *l)
{
+ Cursor start = t->cursor;
+ start.state = l->cursor_state;
fprintf(f, "Line Info:\n");
fprintf(f, "\tLength: %ld\n", line_length(l));
fprintf(f, "\tHas Unicode: %d\n", l->has_unicode);
- fput_cursor_info(f, l->cursor_state);
+ fput_cursor_info(f, start);
Cursor end = simulate_line(t, l);
fprintf(f, "After Line Cursor State:\n");
- fput_cursor_info(f, end.state);
+ fput_cursor_info(f, end);
}
static void