Adding the following lines:
textBox->setBorder( BorderSize( 32, 32, 32, 32 ) );
textBox->setIndents( 16, 16 );
to MainDemoWindow.cpp in the ctor for class SourceCodeWindow causes the TextEditor object to malfunction.
First of all, I believe that TextEditor::getTextIndexAt() should subtract borderSize from the coordinates (it doesn’t). The result is that the TextEditor computes the wrong index in the text for a given coordinate. You can see this by clicking in the modified demo source code window. The caret will appear far below and to the right of the click location.
The second problem I have not figured out. Screen goobers appear when selecting. Place the insertion point on any line. Now, press control shift end, then deselect. A small selection goober will be left at the beginning of the deselected range.
Another way to see the selection goobers is to click on a line and slowly extend the selection to the right with the mouse. The result will be a 1 pixel jagged bottom on the selection border. This will disappear if the window loses focus (since it gets redrawn).