Skip to content

Table::position respected even if it means ArrayOfTables children are not rendered under their parent #1083

@tachibanayui

Description

@tachibanayui

I'm using toml_edit to merge 2 toml documents for updating configuration file. Before serialization, I debug print the DocumentMut and the ast looks fine, but when calling the to_string() function, it produces invalid toml debug ast, source code:

[[edges]]
id = "edge1"
source = "inf5"
target = "inf3"

[[nodes]]
id = "inf"
type = "InputDeviceName"
[nodes.data]
matches = "Micro"
gain = 1.0
mode = "Regex"
channels = []

[nodes.position]
x = 0.0
y = 0.0

[[nodes]]
id = "inf2"
type = "InputDeviceName"
[nodes.data]
matches = "Speakers (High Definition Audio Device)"
mode = "Exact"
gain = 1.0
channels = []

[nodes.position]
x = 0.0
y = 249.0

[[nodes]]
id = "inf3"
type = "OutputDeviceName"
[nodes.data]
matches = "Sp"
gain = 1.0
mode = "Regex"
channels = []

[[nodes]]
id = "inf4"
type = "ProcessCaptureName"

[nodes.position]
x = 291.0
y = 747.0
[nodes.data]
matches = "osu"
gain = 1.0
mode = "Regex"
channels = []

[[nodes]]
id = "inf5"
type = "ProcessCaptureWinTitle"
[nodes.data]
matches = "BSPow"
gain = 1.0
mode = "Regex"
channels = []

[nodes.position]
x = 0.0
y = 498.0

[nodes.position]
x = 0.0
y = 747.0

seems like "inf3" node position had been "pushed down" to "inf4" node which cascade down to others node under it. I tried to fix this by hand and do another debug print and use a diff tool and nothing could indicate a problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-editArea: TOML editing APIA-outputArea: Outputting TOMLC-bugCategory: Things not working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions