From bfef8fd5aa87e75bcd153db431cd988c426c1357 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 25 Sep 2014 19:27:31 +0100 Subject: [PATCH] Fix some cpp autoindent hooks --- rc/cpp.kak | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rc/cpp.kak b/rc/cpp.kak index b53f0787..ae07f7a8 100644 --- a/rc/cpp.kak +++ b/rc/cpp.kak @@ -9,7 +9,7 @@ hook global BufSetOption mimetype=text/x-c(\+\+)? %{ def -hidden _cpp_indent_on_new_line %~ eval -draft -itersel %_ # preserve previous line indent - try %{ exec -draft K } + try %{ exec -draft \;K } # indent after lines ending with { or ( try %[ exec -draft k [{(]\h*$ j ] # cleanup trailing white space son previous line @@ -23,7 +23,7 @@ def -hidden _cpp_indent_on_new_line %~ # indent after visibility specifier try %[ exec -draft k ^\h*(public|private|protected):\h*$ j ] # indent after if|else|while|for - try %[ exec -draft )MB \`(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\' s \`|.\' 11 ] + try %[ exec -draft \;)MB \`(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\' s \`|.\' 11 ] _ ~ @@ -36,7 +36,7 @@ def -hidden _cpp_indent_on_closing_curly_brace %[ # align to opening curly brace when alone on a line try %[ exec -itersel -draft ^\h+\}$hms\`|.\'1 ] # add ; after } if class or struct definition - try %[ exec -draft "hm(class|struct|union)\`(class|struct|union)[^{}\n]+(\n)?\s*\{\'ma;" ] + try %[ exec -draft "hm;(class|struct|union)\`(class|struct|union)[^{}\n]+(\n)?\s*\{\'ma;" ] ] addhl -group / regions -default code cpp \