Handbook
Glossary
point>loc ( point editor -- loc )
Vocabulary
ui
.
gadgets
.
editors
Inputs
point
a pair of integers
editor
an
editor
Outputs
loc
a pair of integers
Word description
Converts a point to a line/column number pair.
Definition
USING:
accessors
arrays
combinators
documents
kernel
math
sequences
ui.gadgets.line-support
ui.text
;
IN:
ui.gadgets.editors
::
point>loc
( point editor -- loc )
point
second
editor
y>line
{
{
[
dup
0
<
]
[
drop
{
0 0
}
]
}
{
[
dup
editor
model>>
last-line#
>
]
[
drop
editor
model>>
doc-end
]
}
[|
n |
n point
first
editor
font>>
n editor
editor-line
x>offset
2array
]
}
cond
;