TextEdit: update highlighting for .go files, make strings lazy match

This commit is contained in:
Luke I. Wilson
2021-04-01 14:40:38 -05:00
parent 58c8de3068
commit 2cd41fc62d

View File

@ -96,7 +96,7 @@ loop:
Filetypes: []string{".go"}, Filetypes: []string{".go"},
Rules: map[*buffer.RegexpRegion]buffer.Syntax { Rules: map[*buffer.RegexpRegion]buffer.Syntax {
&buffer.RegexpRegion{Start: regexp.MustCompile("\\/\\/.*")}: buffer.Comment, &buffer.RegexpRegion{Start: regexp.MustCompile("\\/\\/.*")}: buffer.Comment,
&buffer.RegexpRegion{Start: regexp.MustCompile("\".*\"")}: buffer.String, &buffer.RegexpRegion{Start: regexp.MustCompile("\".*?\"")}: buffer.String,
&buffer.RegexpRegion{ &buffer.RegexpRegion{
Start: regexp.MustCompile("\\b(var|const|if|else|range|for|switch|case|go|func|return|defer|import|type|package)\\b"), Start: regexp.MustCompile("\\b(var|const|if|else|range|for|switch|case|go|func|return|defer|import|type|package)\\b"),
}: buffer.Keyword, }: buffer.Keyword,