Skip to content

Conversation

@dakotahawkins
Copy link
Collaborator

de88fd1 added a check to prevent adding a newline before the last line in
a batch. Since we're prepending, however, a newline is desirable if the
last line is the only one in its group.

Fixes #48

de88fd1 added a check to prevent adding a newline before the last line in
a batch. Since we're prepending, however, a newline is desirable if the
last line is the only one in its group.

Fixes Wumpf#48
@dakotahawkins
Copy link
Collaborator Author

Replaces #49, the NuGet package updates broke 2015 compatibility.

firstLine = false;
}

while (hasElements)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran into this issue again, and I think the above is a cleaner fix.

sortedLines = sortedLines.Where(sortedLine => !string.IsNullOrWhiteSpace(sortedLine.RawLine));
}

// Finally, update the actual lines
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing what we were doing before to insert original non-include lines, this merges those in ahead of time. That way, there's less weird broken logic trying to do it on the fly :)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhh I really like the approach with the select that sneaks in the lines from the other enumerator. Never occurred to me to be honest

<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="IncludeToolbox.Andreas Reich.075c2e2b-7b71-45ba-b2e6-c1dadc81cfac" Version="2.2.0.1" Language="en-US" Publisher="Andreas Reich" />
<Identity Id="IncludeToolbox.Andreas Reich.075c2e2b-7b71-45ba-b2e6-c1dadc81cfac" Version="2.2.1" Language="en-US" Publisher="Andreas Reich" />
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug fix versioned

";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll see a lot of empty lines in the "expected output", because every test except one removes duplicates, and there are a lot of duplicates.

@Wumpf Wumpf merged commit 0bd4b77 into Wumpf:master Sep 27, 2017
@dakotahawkins dakotahawkins deleted the feature/fix/newline-before-last-include-group branch September 27, 2017 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants