From f0782d41a9108c040ac4e2b151313a74f49fb45b Mon Sep 17 00:00:00 2001 From: SuperNovaa41 Date: Wed, 15 Jan 2025 18:57:42 -0500 Subject: [PATCH] progress --- src/draw.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/draw.c b/src/draw.c index 8dae315..67f1953 100644 --- a/src/draw.c +++ b/src/draw.c @@ -48,11 +48,21 @@ void refresh_screen(void) void draw_file_buffer(void) { size_t i; + size_t tmp_len; + + char* working_line; + char* tmp_line; // reserve the last line for info for (i = editor.row_offset; i < editor.num_rows && i < (editor.screen_rows + editor.row_offset - 1); i++) { - screen_buffer_append(CLEAR_LINE_STR, CLEAR_LINE_STR_LEN); // clear line first to prevent flickering issues - screen_buffer_append(editor.rows[i].line, editor.rows[i].len); + if (editor.rows[i].len <= editor.screen_cols) { + screen_buffer_append(CLEAR_LINE_STR, CLEAR_LINE_STR_LEN); // clear line first to prevent flickering issues + screen_buffer_append(editor.rows[i].line, editor.rows[i].len); + } + + // want to do line splitting here + // mimick vim in which we split the overflow line to the next below + } }