Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write node groups on a single line when saving a .tscn file #52284

Merged
merged 1 commit into from
Sep 9, 2021

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Aug 31, 2021

Split from #32124.

This makes .tscn files more readable by ensuring sections are always written on a single line. This is compatible with existing scenes (both backwards and forwards-compatible).

As a bonus, it also results in better syntax highlighting on GitHub when using the ini syntax highlighter 🙂

Preview

Before

[gd_scene format=3 uid="uid://dctlrgcoo4tc8"]

[node name="Node2D" type="Node2D" groups=[
"2",
"bar",
"baz",
"foo",
"hello",
"world",
]]
script = null

[node name="Sprite2D" type="Sprite2D" parent="." groups=[
"hello",
]]
position = Vector2(15, 18)
script = null

[node name="Sprite2D2" type="Sprite2D" parent="."]
script = null

After

[gd_scene format=3 uid="uid://dctlrgcoo4tc8"]

[node name="Node2D" type="Node2D" groups=["2", "bar", "baz", "foo", "hello", "world"]]
script = null

[node name="Sprite2D" type="Sprite2D" parent="." groups=["hello"]]
position = Vector2(15, 18)
script = null

[node name="Sprite2D2" type="Sprite2D" parent="."]
script = null

This makes `.tscn` files more readable by ensuring sections are always
written on a single line.
@Calinou Calinou added cherrypick:3.x Considered for cherry-picking into a future 3.x release enhancement topic:core labels Aug 31, 2021
@Calinou Calinou added this to the 4.0 milestone Aug 31, 2021
@Calinou Calinou changed the title Write node groups one a single line when saving a .tscn file Write node groups on a single line when saving a .tscn file Sep 2, 2021
@reduz reduz merged commit be5c75b into godotengine:master Sep 9, 2021
@Calinou Calinou deleted the tscn-groups-write-single-line branch September 9, 2021 23:52
@akien-mga
Copy link
Member

Cherry-picked for 3.4.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants