replaceSelection

Replaces the current selection with a text block

Syntax
aWindow replaceSelection (aBlock, selectMode)
Parameters
aBlock - TextBlock
The text to insert.
selectMode - Integer
sm_select to select the inserted text, sm_limit to move the cursor at the end of the inserted text or sm_ignore to leave the cursor unchanged.
Remarks

The method has no effect if the view is read-only.

All lines of the block except the last one are moved to the section, so the block contains only one line after this call (a block can be re-used for multiple replaces only if it is a single line block).