Skip to content

Augment: Highlight struct just as well as class #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions after/syntax/cpp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,21 @@ endif

syn clear cppStructure
if s:needs_cppstructure_match == 0
syn keyword cppStructure typename namespace template class
syn keyword cppStructure typename namespace template class struct
elseif s:needs_cppstructure_match == 1
syn keyword cppStructure typename namespace template
elseif s:needs_cppstructure_match == 2
syn keyword cppStructure typename namespace class
syn keyword cppStructure typename namespace class struct
elseif s:needs_cppstructure_match == 3
syn keyword cppStructure typename namespace
endif
unlet s:needs_cppstructure_match


" Class name declaration
" Class and struct name declaration
if exists('g:cpp_class_decl_highlight') && g:cpp_class_decl_highlight
syn match cCustomClassKey "\<class\>"
syn match cCustomClassKey "\<struct\>"
hi def link cCustomClassKey cppStructure

" Clear cppAccess entirely and redefine as matches
Expand All @@ -86,6 +87,8 @@ if exists('g:cpp_class_decl_highlight') && g:cpp_class_decl_highlight
" Match the parts of a class declaration
syn match cCustomClassName "\<class\_s\+\w\+\>"
\ contains=cCustomClassKey
syn match cCustomClassName "\<struct\_s\+\w\+\>"
\ contains=cCustomClassKey
syn match cCustomClassName "\<private\_s\+\w\+\>"
\ contains=cCustomAccessKey
syn match cCustomClassName "\<public\_s\+\w\+\>"
Expand Down