summaryrefslogtreecommitdiff
path: root/src/highlight.zig
blob: 297a61f769c952a2a8637eb6d9ed92b9150cb3d9 (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[;2;36m",
            .comment_ml => "\x1b[;2;36m",
            .keyword1 => "\x1b[;1;33m",
            .keyword2 => "\x1b[;32m",
            .number => "\x1b[;31m",
            .string => "\x1b[;35m",

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