Skip to content

Commit

Permalink
Full support for custom brace wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan James authored and rapimo committed Oct 26, 2017
1 parent ad75119 commit 8d6613f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions clang_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def dic_to_yaml_simple(d):
output += ": "
if type(d[k]) is bool:
output += str(d[k]).lower()
elif type(d[k]) is dict:
output += "{" + dic_to_yaml_simple(d[k]) + "}"
else:
output += str(d[k])
n -= 1
Expand Down
20 changes: 19 additions & 1 deletion clang_format_custom.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,25 @@
// bool BeforeCatch Wrap before catch.
// bool BeforeElse Wrap before else.
// bool IndentBraces Indent the wrapped braces themselves.
// "BraceWrapping": "IndentBraces",
// bool SplitEmptyFunction If false, empty function body can be put on a single line.
// bool SplitEmptyRecord If false, empty record (e.g. class, struct or union) body can be put on a single line.
// bool SplitEmptyNamespace If false, empty namespace body can be put on a single line.
"BraceWrapping":{
// "AfterClass": false,
// "AfterControlStatement": false,
// "AfterEnum": false,
// "AfterFunction": false,
// "AfterNamespace": false,
// "AfterObjCDeclaration": false,
// "AfterStruct": false,
// "AfterUnion": false,
// "BeforeCatch": false,
// "BeforeElse": false,
// "IndentBraces": false,
// "SplitEmptyFunction:" true,
// "SplitEmptyRecord": true,
// "SplitEmptyNamespace": true
},

// Break after each annotation on a field in Java files.
// "BreakAfterJavaFieldAnnotations": true,
Expand Down

0 comments on commit 8d6613f

Please sign in to comment.