Fix c-family indent on opening curly brace after if-else

This commit is contained in:
Oleh Hushchenkov 2019-07-25 09:58:33 +03:00
parent be3d0f8b33
commit 8fc705d4cc

View File

@ -114,6 +114,8 @@ define-command -hidden c-family-indent-on-newline %< evaluate-commands -draft -i
define-command -hidden c-family-indent-on-opening-curly-brace %[ define-command -hidden c-family-indent-on-opening-curly-brace %[
# align indent with opening paren when { is entered on a new line after the closing paren # align indent with opening paren when { is entered on a new line after the closing paren
try %[ execute-keys -draft -itersel h<a-F>)M <a-k> \A\(.*\)\h*\n\h*\{\z <ret> <a-S> 1<a-&> ] try %[ execute-keys -draft -itersel h<a-F>)M <a-k> \A\(.*\)\h*\n\h*\{\z <ret> <a-S> 1<a-&> ]
# align indent with opening paren when { is entered on a new line after the else
try %[ execute-keys -draft -itersel hK <a-x> s \belse\b\h*(?://[^\n]+)?\n\h*\{<ret> <a-S> 1<a-&> ]
] ]
define-command -hidden c-family-indent-on-closing-curly-brace %[ define-command -hidden c-family-indent-on-closing-curly-brace %[