summaryrefslogtreecommitdiffstats
path: root/syntax/go.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2016-07-19 10:09:54 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2016-07-19 10:09:54 +0200
commit11f34624aa32ac72dc65e46ea9badb4b16a0edd1 (patch)
tree63c50a215fe4a67e4223c19b4b1dbb9747c14ffd /syntax/go.vim
parent1422f7a75ce0b382d601238c5979b04473b9021e (diff)
downloadvim-polyglot-2.11.3.tar.gz
vim-polyglot-2.11.3.zip
Updatev2.11.3
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\)\>/