Skip to content

Commit

Permalink
update Go syntax file
Browse files Browse the repository at this point in the history
Update the Go syntax file with some recent changes made to vim-go.
  • Loading branch information
bhcleek committed Jan 21, 2024
1 parent c1884c9 commit 4c6f00b
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions runtime/syntax/go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
" go.vim: Vim syntax file for Go.
" Language: Go
" Maintainer: Billie Cleek <[email protected]>
" Latest Revision: 2023-08-21
" Latest Revision: 2024-01-21
" License: BSD-style. See LICENSE file in source repository.
" Repository: https://github.com/fatih/vim-go

Expand Down Expand Up @@ -230,21 +230,31 @@ endif
" import
if s:FoldEnable('import')
syn region goImport start='import (' end=')' transparent fold contains=goImport,goImportString,goComment
syn match goImport /^import ()/ transparent fold contains=goImport
else
syn region goImport start='import (' end=')' transparent contains=goImport,goImportString,goComment
syn match goImport /^import ()/ transparent contains=goImport
endif

" var, const
if s:FoldEnable('varconst')
syn region goVar start='var (' end='^\s*)$' transparent fold
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
syn match goVar /var ()/ transparent fold
\ contains=goVar
syn region goConst start='const (' end='^\s*)$' transparent fold
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
syn match goConst /const ()/ transparent fold
\ contains=goConst
else
syn region goVar start='var (' end='^\s*)$' transparent
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
syn match goVar /var ()/ transparent
\ contains=goVar
syn region goConst start='const (' end='^\s*)$' transparent
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
syn match goConst /const ()/ transparent
\ contains=goConst
endif

" Single-line var, const, and import.
Expand Down

0 comments on commit 4c6f00b

Please sign in to comment.