From fc9af59d2bba3f2107875f92a758dbe61075b8f0 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Tue, 20 Sep 2016 13:36:19 +0100 Subject: [PATCH] Add statement highlight for = delete in C/C++ --- after/syntax/cpp.vim | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/after/syntax/cpp.vim b/after/syntax/cpp.vim index 7d53e50..8be4e81 100644 --- a/after/syntax/cpp.vim +++ b/after/syntax/cpp.vim @@ -16,9 +16,17 @@ syn match cppOperator '\(\s\zs\/\s\ze\|\s\zs<\s\ze\|\s\zs>\s\ze\)' " Match nested namespace expressions: expr:: " ^^^^ syn match cppNestedNameSpecifier '\w[A-Za-z0-9_]*\ze::' -" " Match multi character operators, override cppDelimiter matches for < > -" " ^ ^ +" Match multi character operators, override cppDelimiter matches for < > +" ^ ^ syn match cppOperator '\(<<\ze\s\|\s\zs>>\|>>=\|<<=\|<=\|>=\|->\*\|->\)' +" Match = delete; as a statement +" ^^^^^^ +" TODO: For some reason \zs stop this from matching, so the cppEquals hack was +" added to work around the failure to highlight in that case. This is terrible +" and a fix needs to be found. +syn match cppEquals '=' +syn match cppStatement '=\s\+delete\ze\s*;' contains=cppEquals +hi default link cppEquals cppOperator " Define additional highlight groups hi default link cppDelimiter Delimiter