From 36070dd429af69f1042f4ee56488a960c4d8e7ef Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 31 Jul 2012 14:22:57 +0200 Subject: CommandManager: rework command parser a new type of strings is supported inspired by the ruby strings. %content, if opening delimiter is one of ([{<, then closing delimiter is the matching )]}> and balanced delimiters in the string needs not to be escaped, else the closing delimiter is the same as the opening one. shell expansion is available through %shcommand syntax. Command flags have been removed, as these strings provide proper nesting support, so now, you can for example do: def command %{ echo %sh{ ls } } --- src/rc/diff.kak | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/rc/diff.kak') diff --git a/src/rc/diff.kak b/src/rc/diff.kak index 8a9a390f..434026ab 100644 --- a/src/rc/diff.kak +++ b/src/rc/diff.kak @@ -1,11 +1,14 @@ -hook global BufCreate .*\.(diff|patch) \ +hook global BufCreate .*\.(diff|patch) %{ setb filetype diff +} -hook global WinSetOption filetype=diff \ - addhl group diff-highlight; \ - addhl -group diff-highlight regex "^\+[^\n]*\n" green default; \ - addhl -group diff-highlight regex "^-[^\n]*\n" red default; \ - addhl -group diff-highlight regex "^@@[^\n]*@@" cyan default; +hook global WinSetOption filetype=diff %{ + addhl group diff-highlight + addhl -group diff-highlight regex "^\+[^\n]*\n" green default + addhl -group diff-highlight regex "^-[^\n]*\n" red default + addhl -group diff-highlight regex "^@@[^\n]*@@" cyan default +} -hook global WinSetOption filetype=(?!diff).* \ +hook global WinSetOption filetype=(?!diff).* %{ rmhl diff-highlight +} -- cgit v1.2.3