 : delete-to-end-of-line ( editor -- ) 
     one-line-elt editor-backspace ;
 
-: com-undo ( editor -- )
-    model>> undo ;
-
-: com-redo ( editor -- )
-    model>> redo ;
+: com-undo ( editor -- ) model>> undo ;
+
+: com-redo ( editor -- ) model>> redo ;
 
 editor "editing" f {
     { undo-action com-undo }


: compute-selection ( editor -- assoc )
    dup gadget-selection? [
        [ selection-start/end [ [ first ] bi@ [a,b] ] 2keep ] keep model>>
        '[ [ _ _ ] keep _ start/end-on-line 2array ] H{ } map>assoc
    ] [ drop f ] if ;

:: draw-selection ( line pair editor -- )

    editor new-editor ;

: activate-editor-model ( editor model -- )
    [ add-connection ]
    [ nip activate-model ]
    [ swap model>> add-loc ] 2tri ;

: deactivate-editor-model ( editor model -- )
    [ remove-connection ]
    [ nip deactivate-model ]
    [ swap model>> remove-loc ] 2tri ;

: blink-caret ( editor -- )
    [ not ] change-blink relayout-1 ;
