render_buffer no longer overwrites the cpp token coloring for keywords

This commit is contained in:
Peter Slattery 2025-07-07 19:39:30 -07:00
parent 3dafcdd950
commit 73492010b3
1 changed files with 3 additions and 3 deletions

View File

@ -390,7 +390,6 @@ function void default_render_buffer(
break; break;
} }
ARGB_Color token_color = color_default;
Token *token = token_it_read(&it); Token *token = token_it_read(&it);
if (token->kind == TokenBaseKind_Operator || if (token->kind == TokenBaseKind_Operator ||
token->kind == TokenBaseKind_ScopeOpen || token->kind == TokenBaseKind_ScopeOpen ||
@ -399,7 +398,7 @@ function void default_render_buffer(
token->kind == TokenBaseKind_ParentheticalClose || token->kind == TokenBaseKind_ParentheticalClose ||
token->kind == TokenBaseKind_StatementClose) token->kind == TokenBaseKind_StatementClose)
{ {
token_color = color_operator; paint_text_color(app, text_layout_id, Ii64_size(token->pos, token->size), color_operator);
} }
else else
{ {
@ -416,6 +415,7 @@ function void default_render_buffer(
if (note != 0) if (note != 0)
{ {
ARGB_Color token_color = color_default;
switch (note->note_kind) switch (note->note_kind)
{ {
case CodeIndexNote_Type: token_color = color_type; break; case CodeIndexNote_Type: token_color = color_type; break;
@ -423,11 +423,11 @@ function void default_render_buffer(
case CodeIndexNote_Macro: token_color = color_macro; break; case CodeIndexNote_Macro: token_color = color_macro; break;
default: {} break; default: {} break;
} }
}
}
paint_text_color(app, text_layout_id, Ii64_size(token->pos, token->size), token_color); paint_text_color(app, text_layout_id, Ii64_size(token->pos, token->size), token_color);
} }
} }
}
}
else else
{ {
paint_text_color(app, text_layout_id, visible_range, color_default); paint_text_color(app, text_layout_id, visible_range, color_default);