Selaa lähdekoodia

Match go container openers to ContainerChars

Andrew Swistak 8 vuotta sitten
vanhempi
commit
23b2598673
1 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  1. 7 4
      after/syntax/go.vim

+ 7 - 4
after/syntax/go.vim

@@ -2,7 +2,9 @@ if !exists("g:go_highlight_fields")
   let g:go_highlight_fields = 0
 endif
 if g:go_highlight_fields != 0
-  syn match goField                 /\(\.\)\@<=\w\+\([.\ \n\r\:\)\[,]\)\@=/
+  syn match goField                 /\(\.\)\@<=\w\+\([.\ \n\r\)\[,]\)\@=/
+  " Match fields in type constructors
+  syn match goField                 /\([{, ]\|\s\)\@<=\w\+\(:\)\@=/
 endif
 
 if !exists("g:go_highlight_functions")
@@ -25,10 +27,11 @@ if g:go_highlight_types != 0
   syn match goDeclType             /\<\(interface\|struct\)\>/ skipwhite skipnl
 endif
 
-hi link goReceiverOpen    Operator
-hi link goReceiverClose   Operator
+hi link goReceiverOpen    ContainerChars
+hi link goReceiverClose   ContainerChars
+hi link goTypeOpen        ContainerChars
+
 hi link goPointerOperator Operator
-hi link goTypeOpen        Operator
 
 hi link goMethodCall   Function
 hi link goFunctionCall Function