ahkpp icon indicating copy to clipboard operation
ahkpp copied to clipboard

Formatter replaces multiple spaces with a single space inside a string

Open hubisan opened this issue 1 year ago • 1 comments

Description

The formatter shouldn't replaces multiple spaces with a single space inside strings enclosed with quotations marks.

Snippet before formatting

string_with_multiple_spaces := "  "
string_with_multiple_spaces_2 := " ahk   is    nice   "

Expected formatted output snippet

Multiple spaces inside a string should be preserved:

string_with_multiple_spaces := "  "
string_with_multiple_spaces_2 := " ahk   is    nice   "

Actual formatted output snippet

Multiple spaces are replaced with a single space:

string_with_multiple_spaces := " "
string_with_multiple_spaces_2 := " ahk is nice "

hubisan avatar Sep 21 '23 07:09 hubisan

This is the Trim Extra Spaces setting, you can turn it off and it should be off by default for this reason--thanks for reporting this! Leaving this bug open until I write some code again, should be a very easy fix :)

Ctrl + comma to open settings, then find this one and toggle it off:

AHK++ > formatter: trim extra spaces setting

mark-wiemer avatar Sep 30 '23 03:09 mark-wiemer

Because this is a bug, fixing this is not a semver-major change. Going to go ahead with this now

mark-wiemer avatar Oct 18 '24 04:10 mark-wiemer

Ref #189 and #191. This bug was introduced in AHK++ 3.0.0

mark-wiemer avatar Oct 18 '24 04:10 mark-wiemer