From 2513495fd08416e53fa83929b1b81ca1aadcda44 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Fri, 4 Sep 2015 13:55:25 +0300 Subject: [PATCH] Highlight escape sequences in strings only, empty the mimetype to have proper syntax highlighting --- rc/dlang.kak | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rc/dlang.kak b/rc/dlang.kak index 05bc3f85..6ea1d190 100644 --- a/rc/dlang.kak +++ b/rc/dlang.kak @@ -5,6 +5,7 @@ # ‾‾‾‾‾‾‾‾‾ hook global BufCreate .*\.di? %{ + set buffer mimetype "" set buffer filetype dlang } @@ -27,9 +28,9 @@ addhl -group /dlang/token fill meta addhl -group /dlang/disabled fill rgb:777777 addhl -group /dlang/comment fill comment +addhl -group /dlang/string regex "\\\(x[0-9a-fA-F]{2}|[0-7]{1,3}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})\>" 0:value addhl -group /dlang/code regex %{\<(true|false|null|__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__|__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__)\>|'((\\.)?|[^'\\])'} 0:value addhl -group /dlang/code regex "-?([0-9_]*\.(?!0[xXbB]))?\<([0-9_]+|0[xX][0-9a-fA-F_]*\.?[0-9a-fA-F_]+|0[bb][01_]+)([ep]-?[0-9_]+)?[fFlLuUi]*\>" 0:value -addhl -group /dlang/code regex "\\\(x[0-9a-fA-F]{2}|[0-7]{1,3}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})\>" 0:value addhl -group /dlang/code regex "\<(this)\>\s*[^(]" 1:value addhl -group /dlang/code regex "\<(bool|byte|cdouble|cfloat|char|creal|dchar|double|dstring|float|idouble|ifloat|int|ireal|long|ptrdiff_t|real|size_t|short|string|ubyte|uint|ulong|ushort|void|wchar|wstring)\>" 0:type addhl -group /dlang/code regex "\<(alias|asm|assert|body|cast|class|delegate|delete|enum|function|import|in|interface|invariant|is|lazy|mixin|module|new|out|pragma|struct|super|typeid|typeof|union|unittest|__parameters|__traits|__vector)\>" 0:keyword