From 6745c49110838db9ac39e85bbcf690b40bc20f83 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 23 Jan 2015 21:09:23 +0100 Subject: Update all packages --- syntax/go.vim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'syntax/go.vim') diff --git a/syntax/go.vim b/syntax/go.vim index 4ee39a71..7b0fbaf5 100644 --- a/syntax/go.vim +++ b/syntax/go.vim @@ -67,6 +67,10 @@ if !exists("g:go_highlight_structs") let g:go_highlight_structs = 0 endif +if !exists("g:go_highlight_build_constraints") + let g:go_highlight_build_constraints = 0 +endif + syn case match syn keyword goDirective package import @@ -270,6 +274,21 @@ endif hi def link goStruct Function hi def link goStructDef Function +" Build Constraints +if g:go_highlight_build_constraints != 0 + syn keyword goBuildOs contained ignore cgo android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows + syn keyword goBuildArch contained 386 amd64 amd64p32 arm + syn match goBuildDirective display contained "+build" + syn region goBuildComment start="//\s*+build" end="$" contains=goBuildDirective,goBuildOs,goBuildArch + syn region goBuildComment start="/\*\s*+build" end="\*/" contains=goBuildDirective,goBuildOs,goBuildArch +endif + +hi def link goBuildComment Comment +hi def link goBuildOs Type +hi def link goBuildArch Type +hi def link goBuildDirective PreProc + + " Search backwards for a global declaration to start processing the syntax. "syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/ -- cgit v1.2.3