ui.tools.listener: read-unsafe for interactor†
†there's a failing test with this patch that needs investigation: === resource:basis/ui/tools/listener/listener-tests.factor: 90 Unit Test: { [ t ] [ "promise" get 2 seconds ?promise-timeout text = ] } wait-timeout ===db4
parent
7caed69d26
commit
a9ab3db167
|
@ -23,6 +23,7 @@ IN: ui.tools.listener
|
||||||
! evaluate-input resumes the thread.
|
! evaluate-input resumes the thread.
|
||||||
TUPLE: interactor < source-editor
|
TUPLE: interactor < source-editor
|
||||||
output history flag mailbox thread waiting token-model word-model popup ;
|
output history flag mailbox thread waiting token-model word-model popup ;
|
||||||
|
INSTANCE: interactor noncopying-reader
|
||||||
|
|
||||||
: register-self ( interactor -- )
|
: register-self ( interactor -- )
|
||||||
<mailbox> >>mailbox
|
<mailbox> >>mailbox
|
||||||
|
@ -150,15 +151,14 @@ M: interactor stream-readln
|
||||||
3bi
|
3bi
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
M: interactor stream-read
|
M:: interactor stream-read-unsafe ( n buf interactor -- count )
|
||||||
swap [
|
n [ 0 ] [
|
||||||
drop ""
|
interactor interactor-read dup [ "\n" join ] when
|
||||||
] [
|
n short head-slice 0 buf copy
|
||||||
[ interactor-read dup [ "\n" join ] when ] dip short head
|
|
||||||
] if-zero ;
|
] if-zero ;
|
||||||
|
|
||||||
M: interactor stream-read-partial
|
M: interactor stream-read-partial-unsafe
|
||||||
stream-read ;
|
stream-read-unsafe ; inline
|
||||||
|
|
||||||
M: interactor stream-read1
|
M: interactor stream-read1
|
||||||
dup interactor-read {
|
dup interactor-read {
|
||||||
|
|
Loading…
Reference in New Issue