Fix UI listener bug with EOF

db4
Slava Pestov 2008-02-02 00:30:36 -06:00
parent bce173d749
commit a114819088
2 changed files with 7 additions and 6 deletions

View File

@ -3,9 +3,10 @@
USING: arrays assocs combinators continuations documents
ui.tools.workspace hashtables io io.styles kernel math
math.vectors models namespaces parser prettyprint quotations
sequences strings threads listener tuples ui.commands ui.gadgets
ui.gadgets.editors ui.gadgets.presentations ui.gadgets.worlds
ui.gestures definitions ;
sequences sequences.lib strings threads listener tuples
ui.commands ui.gadgets ui.gadgets.editors
ui.gadgets.presentations ui.gadgets.worlds ui.gestures
definitions ;
IN: ui.tools.interactor
TUPLE: interactor
@ -97,7 +98,7 @@ M: interactor model-changed
[ set-interactor-continuation stop ] curry callcc1 ;
M: interactor stream-readln
[ interactor-yield ] keep interactor-finish first ;
[ interactor-yield ] keep interactor-finish ?first ;
: interactor-call ( quot interactor -- )
dup interactor-busy? [

View File

@ -77,7 +77,7 @@ M: listener-operation invoke-command ( target command -- )
[ [ run-file ] each ] curry call-listener
] if ;
: com-EOF ( listener -- )
: com-end ( listener -- )
listener-gadget-input interactor-eof ;
: clear-output ( listener -- )
@ -154,7 +154,7 @@ listener-gadget "toolbar" f {
{ f restart-listener }
{ T{ key-down f f "CLEAR" } clear-output }
{ T{ key-down f { C+ } "CLEAR" } clear-stack }
{ T{ key-down f { C+ } "d" } com-EOF }
{ T{ key-down f { C+ } "d" } com-end }
{ T{ key-down f f "F1" } listener-help }
} define-command-map