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

Formatter replaces multiple spaces with a single space inside a string #411

Closed
hubisan opened this issue Sep 21, 2023 · 3 comments · Fixed by #550
Closed

Formatter replaces multiple spaces with a single space inside a string #411

hubisan opened this issue Sep 21, 2023 · 3 comments · Fixed by #550
Assignees
Labels
bug something isn't working formatter code formatter issues

Comments

@hubisan
Copy link

hubisan commented Sep 21, 2023

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 hubisan added bug something isn't working formatter code formatter issues labels Sep 21, 2023
@hubisan hubisan changed the title Formatter replaces multiple spaces with a single space inside a string " " --> " " Formatter replaces multiple spaces with a single space inside a string Sep 21, 2023
@mark-wiemer
Copy link
Member

mark-wiemer commented Sep 30, 2023

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 mark-wiemer added semver-major fixing this will require bumping the major version and removed semver-major fixing this will require bumping the major version labels Oct 18, 2024
@mark-wiemer
Copy link
Member

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

@mark-wiemer mark-wiemer pinned this issue Oct 18, 2024
@mark-wiemer
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working formatter code formatter issues
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants