     ] [
         [ draw-selection ]
         [
-            [ [ first2 ] [ selection-color>> ] bi* <selection> ] keep
-            draw-unselected-line
+            [ [ first2 ] [ selection-color>> ] bi* <selection> ]
+            [ draw-unselected-line ] bi
         ] 3bi
     ] if ;
 

    ] [ drop ] if ;

M: editor graft*
    dup
    dup caret>> activate-editor-model
    dup mark>> activate-editor-model ;

M: editor ungraft*
    dup
    dup stop-blinking
    dup caret>> deactivate-editor-model
    dup mark>> deactivate-editor-model ;

: editor-caret ( editor -- loc ) caret>> value>> ;


    "\n" swap user-input* drop ;

: change-selection ( editor quot -- )
    '[ gadget-selection @ ] [ user-input* drop ] bi ; inline

: join-lines ( string -- string' )
    "\n" split
