Merge remote-tracking branch 'laelath/c-indent-edits'
This commit is contained in:
commit
c8fd1e1cf6
|
@ -48,6 +48,8 @@ define-command -hidden c-family-indent-on-newline %< evaluate-commands -draft -i
|
|||
try %< execute-keys -draft k <a-x> s[a-zA-Z0-9_-]+:\h*$<ret> j <a-gt> >
|
||||
# indent after a statement not followed by an opening brace
|
||||
try %< execute-keys -draft k <a-x> <a-k>\b(if|else|for|while)\h*\(.+?\)\h*$<ret> j <a-gt> >
|
||||
# deindent after a single line statement end
|
||||
try %< execute-keys -draft K <a-x> <a-k>\;\h*$<ret> K <a-x> s\b(if|else|for|while)\h*\(.*\)\h*$|.\z<ret> 1<a-&> >
|
||||
# align to the opening parenthesis or opening brace (whichever is first)
|
||||
# on a previous line if its followed by text on the same line
|
||||
try %< evaluate-commands -draft %<
|
||||
|
|
1
test/indent/c-family/deindent-if-body/cmd
Normal file
1
test/indent/c-family/deindent-if-body/cmd
Normal file
|
@ -0,0 +1 @@
|
|||
c<ret>baz<esc>
|
2
test/indent/c-family/deindent-if-body/in
Normal file
2
test/indent/c-family/deindent-if-body/in
Normal file
|
@ -0,0 +1,2 @@
|
|||
if (int i = bar())
|
||||
foo();%( )
|
3
test/indent/c-family/deindent-if-body/out
Normal file
3
test/indent/c-family/deindent-if-body/out
Normal file
|
@ -0,0 +1,3 @@
|
|||
if (int i = bar())
|
||||
foo();
|
||||
baz
|
3
test/indent/c-family/deindent-if-body/rc
Normal file
3
test/indent/c-family/deindent-if-body/rc
Normal file
|
@ -0,0 +1,3 @@
|
|||
source "%val{runtime}/colors/default.kak"
|
||||
source "%val{runtime}/rc/core/c-family.kak"
|
||||
set buffer filetype cpp
|
1
test/indent/c-family/deindent-if-body/state
Normal file
1
test/indent/c-family/deindent-if-body/state
Normal file
|
@ -0,0 +1 @@
|
|||
3.4,3.4
|
Loading…
Reference in New Issue
Block a user