| author | |
| committer | |
| log | fea016afc0c1102a4847f4e5676260b14d81096e |
| tree | a109b552cc30b78fc058b8f4a8fd80c8c344a8ba |
| parent | 76f3bdfff8224144e7b57748eb8eda2001d0308d |
3 files changed, 10 insertions(+), 4 deletions(-)
src/errmsg.cpp+4-4| ... | ... | @@ -24,20 +24,20 @@ static void print_err_msg_type(ErrorMsg *err, ErrColor color, ErrType err_type) |
| 24 | 24 | bool is_tty = os_stderr_tty(); |
| 25 | 25 | if (color == ErrColorOn || (color == ErrColorAuto && is_tty)) { |
| 26 | 26 | if (err_type == ErrTypeError) { |
| 27 | os_stderr_set_color(TermColorWhite); | |
| 27 | os_stderr_set_color(TermColorBold); | |
| 28 | 28 | fprintf(stderr, "%s:%" ZIG_PRI_usize ":%" ZIG_PRI_usize ": ", path, line, col); |
| 29 | 29 | os_stderr_set_color(TermColorRed); |
| 30 | 30 | fprintf(stderr, "error:"); |
| 31 | os_stderr_set_color(TermColorWhite); | |
| 31 | os_stderr_set_color(TermColorBold); | |
| 32 | 32 | fprintf(stderr, " %s", text); |
| 33 | 33 | os_stderr_set_color(TermColorReset); |
| 34 | 34 | fprintf(stderr, "\n"); |
| 35 | 35 | } else if (err_type == ErrTypeNote) { |
| 36 | os_stderr_set_color(TermColorWhite); | |
| 36 | os_stderr_set_color(TermColorBold); | |
| 37 | 37 | fprintf(stderr, "%s:%" ZIG_PRI_usize ":%" ZIG_PRI_usize ": ", path, line, col); |
| 38 | 38 | os_stderr_set_color(TermColorCyan); |
| 39 | 39 | fprintf(stderr, "note:"); |
| 40 | os_stderr_set_color(TermColorWhite); | |
| 40 | os_stderr_set_color(TermColorBold); | |
| 41 | 41 | fprintf(stderr, " %s", text); |
| 42 | 42 | os_stderr_set_color(TermColorReset); |
| 43 | 43 | fprintf(stderr, "\n"); |
src/os.cpp+5| ... | ... | @@ -931,6 +931,7 @@ int os_self_exe_path(Buf *out_path) { |
| 931 | 931 | #define VT_GREEN "\x1b[32;1m" |
| 932 | 932 | #define VT_CYAN "\x1b[36;1m" |
| 933 | 933 | #define VT_WHITE "\x1b[37;1m" |
| 934 | #define VT_BOLD "\x1b[0;1m" | |
| 934 | 935 | #define VT_RESET "\x1b[0m" |
| 935 | 936 | |
| 936 | 937 | static void set_color_posix(TermColor color) { |
| ... | ... | @@ -947,6 +948,9 @@ static void set_color_posix(TermColor color) { |
| 947 | 948 | case TermColorWhite: |
| 948 | 949 | fprintf(stderr, VT_WHITE); |
| 949 | 950 | break; |
| 951 | case TermColorBold: | |
| 952 | fprintf(stderr, VT_BOLD); | |
| 953 | break; | |
| 950 | 954 | case TermColorReset: |
| 951 | 955 | fprintf(stderr, VT_RESET); |
| 952 | 956 | break; |
| ... | ... | @@ -989,6 +993,7 @@ void os_stderr_set_color(TermColor color) { |
| 989 | 993 | SetConsoleTextAttribute(stderr_handle, FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_INTENSITY); |
| 990 | 994 | break; |
| 991 | 995 | case TermColorWhite: |
| 996 | case TermColorBold: | |
| 992 | 997 | SetConsoleTextAttribute(stderr_handle, |
| 993 | 998 | FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_INTENSITY); |
| 994 | 999 | break; |
src/os.hpp+1| ... | ... | @@ -21,6 +21,7 @@ enum TermColor { |
| 21 | 21 | TermColorGreen, |
| 22 | 22 | TermColorCyan, |
| 23 | 23 | TermColorWhite, |
| 24 | TermColorBold, | |
| 24 | 25 | TermColorReset, |
| 25 | 26 | }; |
| 26 | 27 |