Skip to content

Commit f1f53f6

Browse files
committed
Rules/AvoidTrailingWhitespace: Fixed issue where lines with a single character, followed by multiple white-spaces were truncated when fixed/formatted
1 parent 0ea441c commit f1f53f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Rules/AvoidTrailingWhitespace.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
5454
}
5555

5656
int startColumnOfTrailingWhitespace = 1;
57-
for (int i = line.Length - 2; i > 0; i--)
57+
for (int i = line.Length - 2; i >= 0; i--)
5858
{
5959
if (line[i] != ' ' && line[i] != '\t')
6060
{

0 commit comments

Comments
 (0)