documents: simplify text+loc.
parent
0bd052500e
commit
3e15dfc4cb
|
@ -77,14 +77,12 @@ CONSTANT: doc-start { 0 0 }
|
||||||
: (doc-range) ( from to line# document -- slice )
|
: (doc-range) ( from to line# document -- slice )
|
||||||
[ start/end-on-line ] 2keep doc-line <slice> ;
|
[ start/end-on-line ] 2keep doc-line <slice> ;
|
||||||
|
|
||||||
: text+loc ( lines loc -- loc )
|
:: text+loc ( lines loc -- loc )
|
||||||
over [
|
lines length 1 = [
|
||||||
over length 1 = [
|
loc first2
|
||||||
nip first2
|
] [
|
||||||
] [
|
loc first lines length 1 - + 0
|
||||||
first swap length 1 - + 0
|
] if lines last length + 2array ;
|
||||||
] if
|
|
||||||
] dip last length + 2array ;
|
|
||||||
|
|
||||||
: prepend-first ( str seq -- )
|
: prepend-first ( str seq -- )
|
||||||
0 swap [ append ] change-nth ;
|
0 swap [ append ] change-nth ;
|
||||||
|
|
Loading…
Reference in New Issue