mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Formatter: Close empty objects on same line
This commit is contained in:
parent
3c424d03a4
commit
703e2626dd
2 changed files with 6 additions and 6 deletions
|
@ -153,6 +153,9 @@ class Formatter:
|
||||||
current_line = current_line[:-1]
|
current_line = current_line[:-1]
|
||||||
commit_current_line()
|
commit_current_line()
|
||||||
current_line = "]"
|
current_line = "]"
|
||||||
|
elif str(last_not_whitespace) in OPENING_TOKENS:
|
||||||
|
end_str = end_str.strip()
|
||||||
|
commit_current_line(LineType.BLOCK_CLOSE, True, 0)
|
||||||
|
|
||||||
indent_levels -= 1
|
indent_levels -= 1
|
||||||
commit_current_line(LineType.BLOCK_CLOSE, True)
|
commit_current_line(LineType.BLOCK_CLOSE, True)
|
||||||
|
|
|
@ -20,12 +20,10 @@ template $MyTemplate: Label {
|
||||||
flags: a | b;
|
flags: a | b;
|
||||||
|
|
||||||
[child]
|
[child]
|
||||||
Label {
|
Label {}
|
||||||
}
|
|
||||||
|
|
||||||
[child]
|
[child]
|
||||||
Label label2 {
|
Label label2 {}
|
||||||
}
|
|
||||||
|
|
||||||
// Single line comment.
|
// Single line comment.
|
||||||
|
|
||||||
|
@ -40,8 +38,7 @@ template $MyTemplate: Label {
|
||||||
|
|
||||||
Dialog {
|
Dialog {
|
||||||
[action response=ok]
|
[action response=ok]
|
||||||
$MyButton {
|
$MyButton {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
menu menu {
|
menu menu {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue