From 7b6315b5f5b5b3d37b21e5a85ad6eb75f0f7d70d Mon Sep 17 00:00:00 2001 From: slava Date: Wed, 29 Nov 2006 20:19:04 +0000 Subject: [PATCH] Interactor history fix --- core/ui/text/interactor.factor | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/ui/text/interactor.factor b/core/ui/text/interactor.factor index 3f3941168c..c6caf7e4aa 100644 --- a/core/ui/text/interactor.factor +++ b/core/ui/text/interactor.factor @@ -22,15 +22,16 @@ M: interactor graft* : interactor-input. ( string interactor -- ) interactor-output [ - dup string? [ - dup print-input - ] [ - short. - ] if + dup string? [ dup print-input ] [ short. ] if ] with-stream* ; +: add-interactor-history ( str interactor -- ) + over empty? [ 2drop ] [ interactor-history push-new ] if ; + : interactor-finish ( obj interactor -- ) - dup editor-text over interactor-input. + [ editor-text ] keep + [ interactor-input. ] 2keep + [ add-interactor-history ] keep dup control-model clear-doc interactor-continuation continue-with ; @@ -52,7 +53,6 @@ M: interactor graft* M: interactor stream-readln [ - over empty? [ 2dup interactor-history push-new ] unless interactor-finish ] interactor-yield ;