while (currPos < formatted.length() && ScannerHelper.isWhitespace(formatted.charAt(currPos))) {
currPos++;
}
}
for (int i= 0; i < markers.size(); i++) { // markers.size can change!
NodeMarker curr= (NodeMarker) markers.get(i);
int offset= curr.offset;
if (offset != currPos) {
String insertStr= formatted.substring(currPos, offset);
doTextInsert(insertOffset, insertStr, editGroup); // insert until the marker's begin