godot-gdscript-toolkit icon indicating copy to clipboard operation
godot-gdscript-toolkit copied to clipboard

gdformat: Strange formatting of long lines

Open Cretezy opened this issue 8 months ago • 0 comments

Example 1:

func random_color() -> Color:
	return Color.from_hsv(
		randf(),
		randf_range(0.2, 0.6),
		randf_range(0.9, 1.0),
	)
func random_color() -> Color:
	return (
		Color
		. from_hsv(
			randf(),
			randf_range(0.2, 0.6),
			randf_range(0.9, 1.0),
		)
	)

Example 2:

func _ready() -> void:
	print(
		"[%s] player ready: %s %s"
		% [multiplayer.get_unique_id(), player_data.id, player_data.color.to_html()]
	)
func _ready() -> void:
	print(
		(
			"[%s] player ready: %s %s"
			% [multiplayer.get_unique_id(), player_data.id, player_data.color.to_html()]
		)
	)

(same as https://github.com/Scony/godot-gdscript-toolkit/issues/305)

Cretezy avatar Apr 14 '25 21:04 Cretezy