fix not printing Error: when terminal has no color support

This commit is contained in:
Laytan Laats
2024-06-07 16:41:26 +02:00
parent 29250f2657
commit e627fcb0e6
2 changed files with 3 additions and 5 deletions

View File

@@ -390,8 +390,6 @@ gb_internal void error_va(TokenPos const &pos, TokenPos end, char const *fmt, va
error_out_empty();
} else {
error_out_pos(pos);
}
if (has_ansi_terminal_colours()) {
error_out_coloured("Error: ", TerminalStyle_Normal, TerminalColour_Red);
}
error_out_va(fmt, va);
@@ -427,8 +425,8 @@ gb_internal void warning_va(TokenPos const &pos, TokenPos end, char const *fmt,
error_out_empty();
} else {
error_out_pos(pos);
error_out_coloured("Warning: ", TerminalStyle_Normal, TerminalColour_Yellow);
}
error_out_coloured("Warning: ", TerminalStyle_Normal, TerminalColour_Yellow);
error_out_va(fmt, va);
error_out("\n");
show_error_on_line(pos, end);
@@ -841,4 +839,4 @@ gb_internal void print_all_errors(void) {
gb_file_write(f, res, gb_string_length(res));
errors_already_printed = true;
}
}