A computer-implemented method of processing text. A method includes
providing a unit of text to a text buffer. The unit of text is divided
into one or more shift blocks and one or more replacement blocks. Based
on a replacement operation of replacing each replacement block with
replacement text, a final position of each shift block within the text
buffer is determined. A schedule for the replacement operation is then
determined based at least in part on the final position of each shift
block.