summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-01 14:51:11 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-01 14:51:11 -0500
commitfe4d14a5bb135a925bb47fe88b1a78df0d03cd49 (patch)
tree27f2bae9aaaea8ec0990e46a87a1d58b4e7669ab /buffer.c
parente53329668e403a6b73bc8c9b56ad6b55eecba4e9 (diff)
start per-buffer language
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/buffer.c b/buffer.c
index 9a0627f..2b9957c 100644
--- a/buffer.c
+++ b/buffer.c
@@ -1980,7 +1980,7 @@ void buffer_render(TextBuffer *buffer, Rect r) {
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);
+ syntax_highlight(&syntax_state, buffer->language, line->str, line->len, NULL);
}
for (u32 line_idx = start_line; line_idx < nlines; ++line_idx) {
@@ -1988,7 +1988,7 @@ void buffer_render(TextBuffer *buffer, Rect r) {
if (arr_len(char_types) < line->len) {
arr_set_len(char_types, line->len);
}
- syntax_highlight(&syntax_state, LANG_C, line->str, line->len, char_types);
+ syntax_highlight(&syntax_state, buffer->language, line->str, line->len, char_types);
for (u32 i = 0; i < line->len; ++i) {
char32_t c = line->str[i];
SyntaxCharType type = char_types[i];