Open theperiscope opened 1 year ago
The way it currently works is that it strips the first n characters from subsequent lines, where n is the number of whitespace characters between the start of the first line and the start of the selection.
E.g. if you have 8 spaces line in your example, and start the selection 4 spaces before the start of public
, only 4 spaces will be removed from the start of the rest of the lines in the selection.
No checks are done to see if there are more whitespaces in the selection before the first non-whitespace character, and worse, no checks are made to make sure no non-whitespace characters are removed on subsequent lines.
This issue is somewhat related to #96.
Environment: VS2022 17.3.0, latest version of extension, .NET 5 C# code
Test C# code:
Steps to reproduce:
public
to}
public
to}
Actual Results: Based on above steps, I can infer that to consistently tie the 3 cases above the C# code is copied without indentation stripping amount of space equal to start position where the selection begins - so for first characters result is 0.
Expectation: Strip indentation independent of where the start of the selection is.