Fix corner case in C indentation

This commit is contained in:
Maxime Coste 2017-01-02 04:15:12 +00:00
parent ac1192f58a
commit d5231c713e
5 changed files with 12 additions and 1 deletions

View File

@ -40,7 +40,7 @@ def -hidden c-family-indent-on-newline %[ eval -draft -itersel %[
# remove previous empty lines resulting from the automatic indent # remove previous empty lines resulting from the automatic indent
try %[ exec -draft k <a-x> <a-k>^\h+$<ret> Hd ] try %[ exec -draft k <a-x> <a-k>^\h+$<ret> Hd ]
# indent after an opening brace # indent after an opening brace
try %[ exec -draft K s\{\h*$<ret> j <a-gt> ] try %[ exec -draft k <a-x> s\{\h*$<ret> j <a-gt> ]
# indent after a label # indent after a label
try %[ exec -draft k <a-x> s[a-zA-Z0-9_-]+:\h*$<ret> j <a-gt> ] try %[ exec -draft k <a-x> s[a-zA-Z0-9_-]+:\h*$<ret> j <a-gt> ]
# indent after a statement not followed by an opening brace # indent after a statement not followed by an opening brace

View File

@ -0,0 +1 @@
i<ret><esc>

View File

@ -0,0 +1,3 @@
namespace A
%({)
struct B;

View File

@ -0,0 +1,4 @@
namespace A
{
struct B;

View File

@ -0,0 +1,3 @@
source "%val{runtime}/colors/default.kak"
source "%val{runtime}/rc/core/c-family.kak"
set buffer filetype cpp