WarWithinMe / better-align

A vscode extension to provide better vertical alignment
Other
75 stars 39 forks source link

Aligning strings ending with backslash in PowerShell #65

Open allen-chin opened 4 years ago

allen-chin commented 4 years ago

In PowerShell, backticks (`) are unfortunately used instead of backslash ('\') as an escape character. This means that variable assignments like such are valid:

$path = 'C:\Users\username\'

Unfortunately, they won't align at all if that is used:

$path = 'C:\Users\username\'
$path2 = 'C:\Users\username'

Should be:

$path  = 'C:\Users\username\'
$path2 = 'C:\Users\username'

A workaround would be to use Join-Path, Path.Combine, or to use only forward slashes (there is one limitation when using with msiexec though).