diff options
Diffstat (limited to 'syntax/cpp.vim')
-rw-r--r-- | syntax/cpp.vim | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/syntax/cpp.vim b/syntax/cpp.vim index 0fd0acc2..a31f3416 100644 --- a/syntax/cpp.vim +++ b/syntax/cpp.vim @@ -6,13 +6,16 @@ endif " Language: C++ " Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp) " Previous Maintainer: Ken Shan <ccshan@post.harvard.edu> -" Last Change: 2017 Jun 05 +" Last Change: 2021 Jan 12 " quit when a syntax file was already loaded if exists("b:current_syntax") finish endif +" inform C syntax that the file was included from cpp.vim +let b:filetype_in_cpp_family = 1 + " Read the C syntax to start with runtime! syntax/c.vim unlet b:current_syntax @@ -59,12 +62,6 @@ if !exists("cpp_no_cpp14") syn case match endif -" C++ 17 extensions -if !exists("cpp_no_cpp17") - syn match cppCast "\<reinterpret_pointer_cast\s*<"me=e-1 - syn match cppCast "\<reinterpret_pointer_cast\s*$" -endif - " C++ 20 extensions if !exists("cpp_no_cpp20") syn keyword cppStatement co_await co_return co_yield requires @@ -74,6 +71,12 @@ if !exists("cpp_no_cpp20") syn keyword cppModule import module export endif +" C++ 17 extensions +if !exists("cpp_no_cpp17") + syn match cppCast "\<reinterpret_pointer_cast\s*<"me=e-1 + syn match cppCast "\<reinterpret_pointer_cast\s*$" +endif + " The minimum and maximum operators in GNU C++ syn match cppMinMax "[<>]?" |