Vocabulary
documents

Inputs
stringa string
froma pair of integers
toa pair of integers
documenta document


Outputs
None

Word description
Replaces all text between two line/column number pairs with string. The string may use either \n, \r\n or \r line separators. This word differs from set-doc-range in that it does not include changes in the Undo and Redo actions.

Errors
Throws an error if from or to is out of bounds.

Side effects
Modifies document

Definition


:: set-doc-range* ( string from to document -- )
from to = string empty? and [
string split-lines :> new-lines new-lines from text+loc
:> new-to new-lines from to document
[ (set-doc-range) ] change-model
new-to document update-locs
] unless ;