summaryrefslogtreecommitdiffstats
path: root/syntax/go.vim
diff options
context:
space:
mode:
Diffstat (limited to 'syntax/go.vim')
-rw-r--r--syntax/go.vim13
1 files changed, 9 insertions, 4 deletions
diff --git a/syntax/go.vim b/syntax/go.vim
index 781364a6..b9b6f705 100644
--- a/syntax/go.vim
+++ b/syntax/go.vim
@@ -288,19 +288,22 @@ if g:go_highlight_operators != 0
syn match goOperator /:=\|||\|<-\|++\|--/
" match ...
syn match goOperator /\.\.\./
+
+ hi def link goPointerOperator Operator
endif
hi def link goOperator Operator
" Functions;
if g:go_highlight_functions != 0
syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction skipwhite skipnl
- syn match goReceiver /([^),]\+)/ contained nextgroup=goFunction contains=goReceiverType skipwhite skipnl
- syn match goReceiverType /\(\s\|*\)\w\+)/hs=s+1,he=e-1 contained
- syn match goFunction /\w\+/ contained
+ syn match goReceiver /(\(\w\|[ *]\)\+)/ contained nextgroup=goFunction contains=goReceiverVar skipwhite skipnl
+ syn match goReceiverVar /\w\+/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained
+ syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
+ syn match goReceiverType /\w\+/ contained
+ syn match goFunction /\w\+/ contained
else
syn keyword goDeclaration func
endif
-hi def link goReceiverType Type
hi def link goFunction Function
" Methods;
@@ -322,6 +325,7 @@ if g:go_highlight_types != 0
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
syn match goDeclType /\<interface\|struct\>/ contained skipwhite skipnl
+ hi def link goReceiverType Type
else
syn keyword goDeclType struct interface
syn keyword goDeclaration type
@@ -364,6 +368,7 @@ if g:go_highlight_build_constraints != 0
hi def link goPackageComment Comment
endif
+hi def goSameId term=bold cterm=bold ctermbg=white ctermfg=black
" Search backwards for a global declaration to start processing the syntax.
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/