Handbook
Glossary
line-selection-spans ( line start end -- spans )
Vocabulary
core-text
Inputs
line
an
object
start
an
object
end
an
object
Outputs
spans
an
object
Definition
USING:
accessors
arrays
core-foundation.arrays
kernel
math.order
sequences
;
IN:
core-text
::
line-selection-spans
( line start end -- spans )
start end
[
min
]
[
max
]
2bi
2array
:>
key line
selection-key>>
key
=
[
line
selection-spans>>
]
[
key
[
line
line-index>utf16
]
map
first2
:>
( a b ) line
line>>
:>
ctline a b
=
[
ctline a
f
CTLineGetOffsetForStringIndex
dup
2array
1array
]
[
ctline
CTLineGetGlyphRuns
CF>array
[
ctline
swap
a b
run-selection-span
]
map
sift
merge-selection-spans
]
if
:>
spans key line
selection-key<<
spans line
selection-spans<<
spans
]
if
;