diff options
| author | WormHeamer | 2025-11-07 18:14:01 -0500 |
|---|---|---|
| committer | WormHeamer | 2025-11-07 18:14:01 -0500 |
| commit | 1d4d7b994f1d1e332408718a29c6491da5c48791 (patch) | |
| tree | 8e3c4ab58ee608ab8545ab11e3392f599ca8b6af | |
| parent | 8c854bdf46df5fb41ea4b56f8529175c90860a8b (diff) | |
clean some stuff up, more cursor movements
| -rw-r--r-- | vui.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -19,6 +19,9 @@ #define CSI "\x1b[" +#define VUI_LOG_OUTPUT 0 +#define VUI_LOG_OUTPUT_FILE "out_log.txt" + /* terminal control */ static void vui_getwinsz(unsigned *w, unsigned *h); @@ -370,9 +373,9 @@ static inline void vui_out_flush(void) { write(STDOUT_FILENO, vui_out, vui_outn); -#if 1 +#if VUI_LOG_OUTPUT static unsigned out_frame = 0; - FILE *f = fopen("out_log.txt", "a"); + FILE *f = fopen(VUI_LOG_OUTPUT_FILE, "a"); assert(f); fprintf(f, "\n\n:: OUTPUT FRAME %u ::\n", ++out_frame); fwrite(vui_out, 1, vui_outn, f); @@ -412,6 +415,10 @@ static inline void curs_move(unsigned *restrict ptr_x, unsigned *restrict ptr_y, abort(); } else if (dst_y > 0) { vui_outf(CSI "%ud", dst_y + 1); + } else if (dst_y == src_y - 1) { + vui_outs(CSI "A"); + } else if (dst_y == src_y -+1) { + vui_outs(CSI "B"); } else { vui_outs(CSI "d"); } |
