mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-12 17:27:50 +08:00
edit: color builtin specials correctly
This commit is contained in:
parent
9096d71704
commit
18b6e705c9
|
@ -25,13 +25,23 @@ func colorFormHead(n parse.Node, ed *Editor) string {
|
|||
}
|
||||
|
||||
func goodFormHead(head string, ed *Editor) bool {
|
||||
if eval.DontSearch(head) {
|
||||
if isBuiltinSpecial[head] {
|
||||
return true
|
||||
} else if eval.DontSearch(head) {
|
||||
return eval.IsExecutable(head)
|
||||
} else {
|
||||
return ed.evaler.Global()["fn-"+head] != nil || ed.isExternal[head]
|
||||
}
|
||||
}
|
||||
|
||||
var isBuiltinSpecial = map[string]bool{}
|
||||
|
||||
func init() {
|
||||
for _, name := range eval.BuiltinSpecialNames {
|
||||
isBuiltinSpecial[name] = true
|
||||
}
|
||||
}
|
||||
|
||||
func colorVariable(n parse.Node, ed *Editor) string {
|
||||
pn, ok := n.(*parse.Primary)
|
||||
if !ok {
|
||||
|
|
Loading…
Reference in New Issue
Block a user