File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,13 +99,14 @@ struct TextObjectHelper {
9999 static String fixMissingSpace (String text)
100100 {
101101 static const String operatorChars = " +-*/% <=>!|&~" ;
102+ auto toCheck = text.upToFirstOccurrenceOf (" " , false , false );
102103
103104 int opEnd = 0 ;
104- while (opEnd < text .length () && operatorChars.containsChar (text [opEnd]))
105+ while (opEnd < toCheck .length () && operatorChars.containsChar (toCheck [opEnd]))
105106 opEnd++;
106107
107- if (opEnd > 0 && opEnd < text .length () && text .substring (opEnd).containsOnly (" 0123456789" ))
108- return text .substring (0 , opEnd) + " " + text.substring (opEnd);
108+ if (opEnd > 0 && opEnd < toCheck .length () && toCheck .substring (opEnd).containsOnly (" 0123456789" ))
109+ return toCheck .substring (0 , opEnd) + " " + text.substring (opEnd);
109110
110111 return text;
111112 }
You can’t perform that action at this time.
0 commit comments