Handbook
Glossary
prev-elt ( loc document elt -- newloc )
Factor handbook
»
UI framework
»
Building user interfaces
»
Pre-made UI gadgets
»
Editor gadgets
»
Documents
»
Document elements
Prev:
doc-elt
Next:
next-elt ( loc document elt -- newloc )
Vocabulary
documents
.
elements
Inputs
loc
a pair of integers
document
a
document
elt
an element
Outputs
newloc
a pair of integers
Generic word contract
Outputs the location of the first occurrence of the element prior to
loc
.
See also
next-elt
Definition
IN:
documents.elements
GENERIC:
prev-elt
( loc document elt -- newloc )
Methods
USING:
documents.elements
documents.elements.private
kernel
unicode
;
M:
char-elt
prev-elt
drop
[
[
last-grapheme-from
]
modify-col
]
prev
;
USING:
documents.elements
kernel
;
M:
doc-elt
prev-elt
3drop
{
0 0
}
;
USING:
documents.elements
kernel
;
M:
one-char-elt
prev-elt
2drop
;
USING:
arrays
documents.elements
kernel
sequences
;
M:
one-line-elt
prev-elt
2drop
first
0
2array
;
USING:
documents.elements
documents.elements.private
kernel
math
;
M:
one-word-elt
prev-elt
drop
[
[
1
-
]
dip
f
prev-word
]
modify-col
;
USING:
accessors
documents
documents.elements
kernel
math
sequences
;
M:
page-elt
prev-elt
nip
2dup
[
first
]
[
#lines>>
]
bi*
<
[
2drop
{
0 0
}
]
[
#lines>>
neg
+line
]
if
;
USING:
documents.elements
documents.elements.private
kernel
;
M:
paragraph-elt
prev-elt
drop
prev-paragraph
;
USING:
documents.elements
documents.elements.private
kernel
math
;
M:
word-elt
prev-elt
drop
[
[
[
1
-
]
dip
blank-at?
prev-word
]
modify-col
]
prev
;
USING:
documents.elements
kernel
;
M:
word-start-elt
prev-elt
drop
one-word-elt
prev-elt
;