- Improved underlining errors/warnings when unicode is used. #2887

This commit is contained in:
Christoffer Lerno
2026-02-11 16:49:14 +01:00
parent 18ab18958b
commit 202349d88f
2 changed files with 8 additions and 7 deletions

View File

@@ -30,6 +30,7 @@
- Flag `--cpu-flags` doesn't work if the first item is an exclusion. #2905
- Reallocating overaligned memory with the LibcAllocator was unsafe.
- Using [] or .foo on $$ functions would not raise error but instead crash
- Improved underlining errors/warnings when unicode is used. #2887
## 0.7.9 Change list

View File

@@ -141,14 +141,14 @@ static void print_error_type_at(SourceSpan location, const char *message, PrintT
unsigned space_to = col_location ? col_location : max_lines_for_display - 1;
for (unsigned i = 0; i < space_to - 1; i++)
{
switch (current[i])
unsigned char c = (unsigned char)current[i];
if (c == '\t')
{
case '\t':
eprintf("\t");
break;
default:
eprintf(" ");
break;
eprintf("\t");
}
else
{
if (c < 128 || (c & 0xC0) == 0xC0) eprintf(" ");
}
}
unsigned len = location.length;