summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c4
1 files changed, 4 insertions, 0 deletions
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];