summaryrefslogtreecommitdiff
path: root/src/rc/cpp.kak
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-10-31 19:22:00 +0000
committerMaxime Coste <frrrwww@gmail.com>2013-11-04 22:02:44 +0000
commit02312fe5ffbde195c4d68321ae407696789d79b9 (patch)
tree4e2067e049543de26ded317f789d7e82dc6f4199 /src/rc/cpp.kak
parent5e54705e26115e6ca77330b16744efb381ac902b (diff)
Allow to ommit the catch part in the try command
Diffstat (limited to 'src/rc/cpp.kak')
-rw-r--r--src/rc/cpp.kak10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rc/cpp.kak b/src/rc/cpp.kak
index 8bcc987a..1db0ca5a 100644
--- a/src/rc/cpp.kak
+++ b/src/rc/cpp.kak
@@ -18,11 +18,11 @@ hook global WinSetOption filetype=cpp %~
addhl -group cpp-highlight regex "^\h*?#.*?(?<!\\)$" 0:macro
addhl -group cpp-highlight regex "(?<!')\".*?(?<!\\)(\\\\)*\"" 0:string
addhl -group cpp-highlight regex "(//[^\n]*\n)|(/\*.*?(\*/|\'))" 0:comment
- hook window InsertEnd .* -id cpp-hooks %{ try %{ exec -draft <a-x>s\h+$<ret>d } catch %{} }
- hook window InsertKey \n -id cpp-hooks %[ try %{ exec -draft k<a-x>s^\h+<ret>yj<a-h>P } catch %{} ] # preserve previous line indent
- hook window InsertKey \n -id cpp-hooks %[ try %[ exec -draft k<a-x><a-k>[{(]\h*$<ret>j<a-gt> ] catch %{} ] # indent after lines ending with { or (
- hook window InsertKey \} -id cpp-hooks %[ try %[ exec -draft <a-h><a-k>^\h+\}$<ret>< ] catch %{} ] # deindent on insert } alone on a line
- hook window InsertKey \n -id cpp-hooks %[ try %{ exec -draft k<a-x>s\h+$<ret>d } catch %{} ] # cleanup trailing white space son previous line
+ hook window InsertEnd .* -id cpp-hooks %{ try %{ exec -draft <a-x>s\h+$<ret>d } }
+ hook window InsertKey \n -id cpp-hooks %[ try %{ exec -draft k<a-x>s^\h+<ret>yj<a-h>P } ] # preserve previous line indent
+ hook window InsertKey \n -id cpp-hooks %[ try %[ exec -draft k<a-x><a-k>[{(]\h*$<ret>j<a-gt> ] ] # indent after lines ending with { or (
+ hook window InsertKey \} -id cpp-hooks %[ try %[ exec -draft <a-h><a-k>^\h+\}$<ret>< ] ] # deindent on insert } alone on a line
+ hook window InsertKey \n -id cpp-hooks %[ try %{ exec -draft k<a-x>s\h+$<ret>d } ] # cleanup trailing white space son previous line
~
hook global WinSetOption filetype=(?!cpp).* %{