summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-31 20:39:36 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-31 20:39:36 -0500
commit442e0b92a09689cd75e2d20608572a279bef5390 (patch)
tree67d5e2a79ffcb1413ed10b49f70a185fef55ef68 /buffer.c
parent68b3e3928e1bd05ebbb56810ae8b7a68ff5f12b0 (diff)
more syntax highlighting
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];