diag: fix printing of snippets containing left brackets
This commit is contained in:
+5
-1
@@ -4,10 +4,10 @@
|
||||
#include "../write.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <fx/core/stringstream.h>
|
||||
#include <fx/term/print.h>
|
||||
#include <fx/term/tty.h>
|
||||
#include <ctype.h>
|
||||
#include <ivy/line-source.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -449,11 +449,15 @@ static void print_snippet(
|
||||
update_highlighting(&printer);
|
||||
|
||||
diag_stream_putc(stream, c);
|
||||
if (c == '[') {
|
||||
diag_stream_putc(stream, c);
|
||||
}
|
||||
|
||||
update_underline(&printer);
|
||||
}
|
||||
|
||||
diag_stream_putc(stream, '\n');
|
||||
|
||||
write_underline(&printer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user