Closed dakotahawkins closed 8 years ago
This is the last thing (for the moment) I really wanted! If you have a bunch of includes and are sorting them with regex precedence groups, it's nice to have a blank line between the groups.
I've tried to account for all the corner cases I could think of, like if there's already a blank line before the start of a group.
I just realized the whole regex function can be made much more efficient. I should have realized it before, but this is something I used in a perl script that had to sort huge files (actually visual studio build logs) using a regex.
Basically it should use a "Schwartzian transform". What that will do is only run the regexes once for everything, instead of several times in the process of doing the compare operation.
.NET may cache regex results behind the scene or something, but since the code I added here has to go through them all another time, I might as well go ahead and add it.
If you want to hold of on this PR I'll just update it, otherwise I'll use a minor version number (1.3.1) since it shouldn't change the behavior at all.
I'm just going to kill this PR and submit another one with both changes to avoid the churn.
The option defaults to false. If true, when sorting includes with regex precedence groups, a blank line will be added after each matching group of include statements.