Ver Fonte

Improve function highlighting when used as a type

Andrew Swistak há 8 anos atrás
pai
commit
423cc91538
1 ficheiros alterados com 4 adições e 1 exclusões
  1. 4 1
      vim/after/syntax/go.vim

+ 4 - 1
vim/after/syntax/go.vim

@@ -56,7 +56,10 @@ if g:go_highlight_functions != 0
 
   syn match goDeclaration          /\<func\>/ nextgroup=goReceiverRegion,goFunction skipwhite skipnl
   syn region goReceiverRegion      matchgroup=goContainer start=/(/ end=/)/ contains=goReceiver nextgroup=goFunction contained
-  syn match goReceiver             /\(\w\|[ *]\)\+/ contained contains=goReceiverVar skipwhite skipnl contained
+  syn match goReceiver             /\(\w\|[ *]\)\+/ contained contains=goReceiverVar,goPointerOperator skipwhite skipnl contained
+  syn match goReceiverVar          /\w\+/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained
+  syn match goPointerOperator      /\*/ nextgroup=goReceiverType contained skipwhite skipnl
+  syn match goReceiverType         /\w\+/ contained
 
   syn cluster validFuncRegionContains contains=@goTypes,goField,goDeclaration,GoBuiltins,goDeclStruct,goDeclInterface,OperatorChars,goContainer,goString,goRawString,@goNumber,goTypeConstructor