-
Notifications
You must be signed in to change notification settings - Fork 0
/
nocolor.go
36 lines (32 loc) · 956 Bytes
/
nocolor.go
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
35
36
package main
import (
"os"
"github.com/xyproto/syntax"
"github.com/xyproto/vt100"
)
func (e *Editor) respectNoColorEnvironmentVariable() {
if os.Getenv("NO_COLOR") != "" {
e.fg = vt100.Default
e.bg = vt100.BackgroundDefault
e.searchFg = vt100.Default
e.gitColor = vt100.Default
syntax.DefaultTextConfig.String = ""
syntax.DefaultTextConfig.Keyword = ""
syntax.DefaultTextConfig.Comment = ""
syntax.DefaultTextConfig.Type = ""
syntax.DefaultTextConfig.Literal = ""
syntax.DefaultTextConfig.Punctuation = ""
syntax.DefaultTextConfig.Plaintext = ""
syntax.DefaultTextConfig.Tag = ""
syntax.DefaultTextConfig.TextTag = ""
syntax.DefaultTextConfig.TextAttrName = ""
syntax.DefaultTextConfig.TextAttrValue = ""
syntax.DefaultTextConfig.Decimal = ""
}
}
func (status *StatusBar) respectNoColorEnvironmentVariable() {
if os.Getenv("NO_COLOR") != "" {
status.fg = vt100.Default
status.bg = vt100.BackgroundDefault
}
}