Skip to content

Commit 7d4c541

Browse files
author
Kapil Borle
committed
Update alignment correction logic
1 parent c0e3545 commit 7d4c541

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Rules/AlignAssignmentStatement.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using System.Globalization;
1717
using System.Linq;
1818
using System.Management.Automation.Language;
19+
using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic;
1920

2021
namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules
2122
{
@@ -134,7 +135,7 @@ private IEnumerable<CorrectionExtent> GetHashtableCorrections(
134135
equalExtent.StartLineNumber,
135136
lhsExtent.EndColumnNumber,
136137
equalExtent.StartColumnNumber,
137-
new String(whitespaceChar, Math.Max(0, columnDiff) + 1),
138+
new String(whitespaceChar, expectedStartColumnNumber - lhsExtent.EndColumnNumber),
138139
GetError());
139140
}
140141

0 commit comments

Comments
 (0)