summaryrefslogtreecommitdiff
path: root/src/highlight.zig
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2021-12-21 05:56:41 +0200
committerGravatar Uko Kokņevičs2021-12-21 05:56:41 +0200
commit2d2278364b6186c6cdf0f0497b0498431dfe7dd1 (patch)
tree8f2329afbc90817c855f5c5154a547a58a9458aa /src/highlight.zig
downloades-2d2278364b6186c6cdf0f0497b0498431dfe7dd1.tar.gz
es-2d2278364b6186c6cdf0f0497b0498431dfe7dd1.tar.xz
es-2d2278364b6186c6cdf0f0497b0498431dfe7dd1.zip
Initial config
Diffstat (limited to 'src/highlight.zig')
-rw-r--r--src/highlight.zig34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/highlight.zig b/src/highlight.zig
new file mode 100644
index 0000000..b0f4cfd
--- /dev/null
+++ b/src/highlight.zig
@@ -0,0 +1,34 @@
1pub const Highlight = enum {
2 none,
3 normal,
4 // Syntax highlighting
5 comment,
6 comment_ml,
7 keyword1,
8 keyword2,
9 number,
10 string,
11 // Other "faces"
12 line_no,
13 match,
14 overlong_line,
15
16 pub fn asString(hl: Highlight) []const u8 {
17 return switch (hl) {
18 .none => "\x1b[m",
19
20 .normal => "\x1b[39m",
21
22 .comment => "\x1b[36m",
23 .comment_ml => "\x1b[36m",
24 .keyword1 => "\x1b[33m",
25 .keyword2 => "\x1b[32m",
26 .number => "\x1b[31m",
27 .string => "\x1b[35m",
28
29 .line_no => "\x1b[0;90m",
30 .match => "\x1b[34m",
31 .overlong_line => "\x1b[91m",
32 };
33 }
34};