Skip to content

Commit

Permalink
Merge pull request #1557 from Carpetsmoker/highlight_methods
Browse files Browse the repository at this point in the history
Rename go_highlight_methods to go_highlight_function_calls
  • Loading branch information
fatih authored Jan 15, 2018
2 parents bf31604 + 264fe46 commit 8308c8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
10 changes: 5 additions & 5 deletions doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ Maximum height for the GoDoc window created with |:GoDoc|. Default is 20. >
*'g:go_doc_url'*

godoc server URL used when |:GoDocBrowser| is used. Change if you want to use
a private internal service. Default is 'https://godoc.org'.
a private internal service. Default is 'https://godoc.org'.
>
let g:go_doc_url = 'https://godoc.org'
<
Expand Down Expand Up @@ -1725,7 +1725,7 @@ Highlight operators such as `:=` , `==`, `-=`, etc.
<
*'g:go_highlight_functions'*

Highlight function names.
Highlight function and method declarations.
>
let g:go_highlight_functions = 0
<
Expand All @@ -1737,11 +1737,11 @@ declarations. Setting this implies the functionality from
>
let g:go_highlight_function_arguments = 0
<
*'g:go_highlight_methods'*
*'g:go_highlight_function_calls'*

Highlight method names.
Highlight function and method calls.
>
let g:go_highlight_methods = 0
let g:go_highlight_function_calls = 0
<
*'g:go_highlight_types'*

Expand Down
14 changes: 6 additions & 8 deletions syntax/go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ if !exists("g:go_highlight_function_arguments")
let g:go_highlight_function_arguments = 0
endif

if !exists("g:go_highlight_methods")
let g:go_highlight_methods = 0
if !exists("g:go_highlight_function_calls")
let g:go_highlight_function_calls = 0
endif

if !exists("g:go_highlight_fields")
Expand Down Expand Up @@ -360,7 +360,6 @@ hi def link goOperator Operator

" Functions;
if g:go_highlight_functions isnot 0 || g:go_highlight_function_arguments isnot 0
syn match goFunctionCall /\w\+\ze(/ contains=goBuiltins,goDeclaration
syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction,goSimpleArguments skipwhite skipnl
syn match goReceiverVar /\w\+\ze\s\+\(\w\|\*\)/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained
syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
Expand All @@ -379,13 +378,12 @@ else
syn keyword goDeclaration func
endif
hi def link goFunction Function
hi def link goFunctionCall Type

" Methods;
if g:go_highlight_methods != 0
syn match goMethodCall /\.\w\+\ze(/hs=s+1
" Function calls;
if g:go_highlight_function_calls != 0
syn match goFunctionCall /\w\+\ze(/ contains=goBuiltins,goDeclaration
endif
hi def link goMethodCall Type
hi def link goFunctionCall Type

" Fields;
if g:go_highlight_fields != 0
Expand Down

0 comments on commit 8308c8d

Please sign in to comment.