summaryrefslogtreecommitdiff
path: root/src/highlight.zig
blob: b0f4cfd00be6727960ac6e779d72eca5cb01cdc1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
pub const Highlight = enum {
    none,
    normal,
    // Syntax highlighting
    comment,
    comment_ml,
    keyword1,
    keyword2,
    number,
    string,
    // Other "faces"
    line_no,
    match,
    overlong_line,

    pub fn asString(hl: Highlight) []const u8 {
        return switch (hl) {
            .none => "\x1b[m",

            .normal => "\x1b[39m",

            .comment => "\x1b[36m",
            .comment_ml => "\x1b[36m",
            .keyword1 => "\x1b[33m",
            .keyword2 => "\x1b[32m",
            .number => "\x1b[31m",
            .string => "\x1b[35m",

            .line_no => "\x1b[0;90m",
            .match => "\x1b[34m",
            .overlong_line => "\x1b[91m",
        };
    }
};