From 9361372418b3b06ea49a3d92669cc10cf123aa60 Mon Sep 17 00:00:00 2001 From: Kristiyan Stoimenov Date: Fri, 3 Feb 2023 20:23:42 +0200 Subject: [PATCH] Augment: Highlight `struct` just as well as `class` Signed-off-by: Kristiyan Stoimenov --- after/syntax/cpp.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/after/syntax/cpp.vim b/after/syntax/cpp.vim index 34e337a..500cf4e 100644 --- a/after/syntax/cpp.vim +++ b/after/syntax/cpp.vim @@ -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 "\" + syn match cCustomClassKey "\" hi def link cCustomClassKey cppStructure " Clear cppAccess entirely and redefine as matches @@ -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 "\" \ contains=cCustomClassKey + syn match cCustomClassName "\" + \ contains=cCustomClassKey syn match cCustomClassName "\" \ contains=cCustomAccessKey syn match cCustomClassName "\"