File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
src/Discord.Net.ComponentDesigner.Generator/Utils Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -39,12 +39,6 @@ public static string NormalizeIndentation(this string str)
3939 var rawLines = str . Split ( '\n ' ) ;
4040 var lines = new List < string > ( rawLines ) ;
4141
42- var minSpacing = lines . Min ( x =>
43- string . IsNullOrWhiteSpace ( x ) ? int . MaxValue : x . TakeWhile ( char . IsWhiteSpace ) . Count ( )
44- ) ;
45-
46- if ( minSpacing is 0 or int . MaxValue ) return str ;
47-
4842 // remove leading empty lines
4943 foreach ( var line in rawLines )
5044 {
@@ -59,10 +53,16 @@ public static string NormalizeIndentation(this string str)
5953 else break ;
6054 }
6155
56+ var minSpacing = lines . Min ( x =>
57+ x . TakeWhile ( char . IsWhiteSpace ) . Count ( )
58+ ) ;
59+
60+ if ( minSpacing is 0 or int . MaxValue ) return str ;
61+
6262 return string . Join (
6363 "\n " ,
6464 lines . Select ( x =>
65- x . Length > minSpacing ? x . Substring ( minSpacing ) : x
65+ x . Length > minSpacing ? x . Substring ( minSpacing ) : string . Empty
6666 )
6767 ) ;
6868 }
You can’t perform that action at this time.
0 commit comments