From e981fb7957f698d547e6bbd7098ba26a3a65785a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 21 Nov 2012 19:07:41 +0100 Subject: [PATCH] cpp.kak: use regex filter to handle indentation --- src/rc/cpp.kak | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/rc/cpp.kak b/src/rc/cpp.kak index d9908fc8..d318df4a 100644 --- a/src/rc/cpp.kak +++ b/src/rc/cpp.kak @@ -9,7 +9,7 @@ hook global BufOpen .* %{ %sh{ fi } } -hook global WinSetOption filetype=cpp %{ +hook global WinSetOption filetype=cpp %~ addhl group cpp-highlight addhl -group cpp-highlight regex "\<(this|true|false|NULL|nullptr|)\>|\<-?\d+[fdiu]?|'((\\.)?|[^'\\])'" 0:value addhl -group cpp-highlight regex "\<(void|int|char|unsigned|float|bool|size_t)\>" 0:type @@ -18,14 +18,15 @@ hook global WinSetOption filetype=cpp %{ addhl -group cpp-highlight regex "(?d } -} +~ hook global WinSetOption filetype=(?!cpp).* %{ - rmhl cpp-highlight; + rmhl cpp-highlight rmfilter cpp-filters }