From 950a734ce595c8fa63af3469c0a085b904634b5b Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 23 Jan 2012 14:00:33 +0000 Subject: [PATCH] adapt rc files to the new hook command --- src/kakrc | 3 +-- src/rc/cpp.kak | 6 ++++-- src/rc/kakrc.kak | 8 +++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/kakrc b/src/kakrc index 675a8751..39aecbc6 100644 --- a/src/kakrc +++ b/src/kakrc @@ -1,5 +1,4 @@ -hook WinInsertEnd .* exec xs\h+(?=\n)d -hook WinCreate .* addhl regex \h+(?=\n) default red +hook global WinCreate .* addhl regex \h+(?=\n) default red runtime rc/cpp.kak runtime rc/kakrc.kak diff --git a/src/rc/cpp.kak b/src/rc/cpp.kak index f25c73dc..8de61c13 100644 --- a/src/rc/cpp.kak +++ b/src/rc/cpp.kak @@ -1,4 +1,4 @@ -hook WinCreate .*\.(c|cc|cpp|cxx|C|h|hh|hpp|hxx|H) \ +hook global WinCreate .*\.(c|cc|cpp|cxx|C|h|hh|hpp|hxx|H) \ addhl group hlcpp; \ addgrouphl hlcpp regex "\<(true|false|NULL|nullptr)\>|\<-?\d+[fdiu]?|'((\\.)?|[^'\\])'" red default; \ addgrouphl hlcpp regex "\<(void|int|char|unsigned|float|bool|size_t)\>" yellow default; \ @@ -8,4 +8,6 @@ hook WinCreate .*\.(c|cc|cpp|cxx|C|h|hh|hpp|hxx|H) \ addgrouphl hlcpp regex "(\`|(?<=\n))\h*#\h*[^\n]*" magenta default; \ addgrouphl hlcpp regex "(//[^\n]*\n)|(/\*.*?(\*/|\'))" cyan default; \ addfilter preserve_indent; \ - addfilter cleanup_whitespaces + addfilter cleanup_whitespaces; \ + hook window InsertEnd .* exec xs\h+(?=\n)d + diff --git a/src/rc/kakrc.kak b/src/rc/kakrc.kak index e2df4cec..09a46770 100644 --- a/src/rc/kakrc.kak +++ b/src/rc/kakrc.kak @@ -1,7 +1,9 @@ -hook WinCreate (.*/)?(kakrc|.*.kak) \ +hook global WinCreate (.*/)?(kakrc|.*.kak) \ addhl group hlkakrc; \ addgrouphl hlkakrc regex \<(hook|addhl|rmhl|addgrouphl|rmgrouphl|addfilter|rmfilter|exec|source|runtime)\> green default; \ addgrouphl hlkakrc regex \<(default|black|red|green|yellow|blue|magenta|cyan|white)\> yellow default; \ - addgrouphl hlkakrc regex (?<=\