From 442e0b92a09689cd75e2d20608572a279bef5390 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Sun, 31 Jan 2021 20:39:36 -0500 Subject: more syntax highlighting --- buffer.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'buffer.c') diff --git a/buffer.c b/buffer.c index 6f1b607..41dc216 100644 --- a/buffer.c +++ b/buffer.c @@ -1974,6 +1974,10 @@ void buffer_render(TextBuffer *buffer, Rect r) { SyntaxState syntax_state = {0}; // dynamic array of character types, to be filled by syntax_highlight SyntaxCharType *char_types = NULL; + for (u32 line_idx = 0; line_idx < start_line; ++line_idx) { + Line *line = &lines[line_idx]; + syntax_highlight(&syntax_state, LANG_C, line->str, line->len, NULL); + } for (u32 line_idx = start_line; line_idx < nlines; ++line_idx) { Line *line = &lines[line_idx]; -- cgit v1.2.3