! XXX: This is the old string-lines behavior, it would be nice
! if we could update documents to work with the new string-lines
! behavior.
-: string-lines ( str -- seq )
+: split-lines ( str -- seq )
dup [ "\r\n" member? ] any? [
"\n" split
[
:: set-doc-range ( string from to document -- )
from to = string empty? and [
- string string-lines :> new-lines
+ string split-lines :> new-lines
new-lines from text+loc :> new-to
from to document doc-range :> old-string
old-string string from to new-to <edit> document add-undo