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

Open
hubisan opened this issue Sep 21, 2023 · 1 comment
Open
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
Collaborator

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

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: No status
Development

No branches or pull requests

2 participants