mark-wiemer-org / ahkpp

AutoHotkey Plus Plus (AHK++) - AutoHotkey v1 and v2 support for VS Code
https://marketplace.visualstudio.com/items?itemName=mark-wiemer.vscode-autohotkey-plus-plus
Other
152 stars 10 forks source link

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

Open hubisan opened 11 months ago

hubisan commented 11 months ago

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 "
mark-wiemer commented 11 months ago

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