Fix excess spacing when beautifying class names with underscores.
This commit is contained in:
parent
d93432f2ed
commit
82f94872cb
2 changed files with 5 additions and 2 deletions
|
|
@ -125,9 +125,11 @@ extend Class SWWMUtility
|
|||
int cp1;
|
||||
[cp1, pos] = workstr.GetNextCodePoint(pos);
|
||||
str.AppendCharacter(cp1);
|
||||
if ( cp1 == 0x20 ) continue; // already spaced
|
||||
if ( i < len-1 )
|
||||
{
|
||||
let [cp2, pos2] = workstr.GetNextCodePoint(pos);
|
||||
if ( cp2 == 0x20 ) continue; // already spaced
|
||||
// this looks awkward, but I have to also account for non-letter characters
|
||||
// uppercase after lowercase
|
||||
if ( (String.CharUpper(cp1) != cp1) && (String.CharLower(cp2) != cp2) )
|
||||
|
|
@ -144,6 +146,7 @@ extend Class SWWMUtility
|
|||
if ( i < len-2 )
|
||||
{
|
||||
let [cp3, pos3] = workstr.GetNextCodePoint(pos2);
|
||||
if ( cp3 == 0x20 ) continue; // already spaced
|
||||
// uppercase before uppercase before lowercase
|
||||
if ( (String.CharLower(cp1) != cp1) && (String.CharLower(cp2) != cp2) && (String.CharUpper(cp3) != cp3) )
|
||||
str.AppendCharacter(0x20);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue