Clear undos when starting a new interaction in the listener

db4
Slava Pestov 2009-01-28 12:12:03 -06:00
parent e33d827b99
commit d651bdc4d7
2 changed files with 5 additions and 4 deletions

View File

@ -22,9 +22,8 @@ TUPLE: history document elements index ;
unless-empty ; unless-empty ;
: update-document ( history -- ) : update-document ( history -- )
[ [ index>> ] [ elements>> ] bi nth string>> ] [ [ index>> ] [ elements>> ] bi nth string>> ] [ document>> ] bi
[ document>> ] bi [ set-doc-string ] [ clear-undo drop ] 2bi ;
set-doc-string ;
: change-history-index ( history i -- ) : change-history-index ( history i -- )
over elements>> length 1- over elements>> length 1-

View File

@ -85,7 +85,9 @@ M: object (print-input)
: interactor-finish ( interactor -- ) : interactor-finish ( interactor -- )
[ history>> history-add ] keep [ history>> history-add ] keep
[ print-input ] [ clear-editor drop ] 2bi ; [ print-input ]
[ clear-editor drop ]
[ model>> clear-undo drop ] 2tri ;
: interactor-eof ( interactor -- ) : interactor-eof ( interactor -- )
dup interactor-busy? [ dup interactor-busy? [