Improve dictionary printing to avoid confusion with arrays

- Add leading and trailing spaces within dictionaries, as the `{}`
  characters are hard to distinguish from `[]` on some fonts.
  This is especially helpful with empty arrays and dictionaries.
This commit is contained in:
Hugo Locurcio
2022-08-18 17:20:55 +02:00
parent 0056acf46f
commit 6afbf0bd5a
7 changed files with 17 additions and 15 deletions
@@ -7,8 +7,8 @@ null
false
empty array
zero Vector2i
{22:{4:["nesting", "arrays"]}}
{4:["nesting", "arrays"]}
{ 22: { 4: ["nesting", "arrays"] } }
{ 4: ["nesting", "arrays"] }
["nesting", "arrays"]
nesting
arrays
@@ -1,2 +1,2 @@
GDTEST_OK
{"a":1, "b":2, "with spaces":3, "2":4}
{ "a": 1, "b": 2, "with spaces": 3, "2": 4 }
@@ -1,2 +1,2 @@
GDTEST_OK
{"hello":{"world":{"is":"beautiful"}}}
{ "hello": { "world": { "is": "beautiful" } } }
@@ -1,5 +1,5 @@
GDTEST_OK
{8:{"key":"value"}}
{"key":"value"}
{ 8: { "key": "value" } }
{ "key": "value" }
value
value
@@ -1,6 +1,6 @@
GDTEST_OK
{1:(2, 0)}
{3:(4, 0)}
{ 1: (2, 0) }
{ 3: (4, 0) }
[[(5, 0)]]
[[(6, 0)]]
[[(7, 0)]]
@@ -21,7 +21,7 @@ hello/world
RID(0)
Node::get_name
Node::[signal]property_list_changed
{"hello":123}
{ "hello": 123 }
["hello", 123]
[255, 0, 1]
[-1, 0, 1]