     [ 3drop { } ]
     if ;
 
-: move-caret ( pane -- )
-    dup hand-rel
-    over sloppy-pick-up
-    over set-pane-caret
-    relayout-1 ;
+: move-caret ( pane -- pane )
+  dup hand-rel
+  over sloppy-pick-up
+  over set-pane-caret
+  dup relayout-1 ;
 
 : begin-selection ( pane -- )
-    dup move-caret f swap set-pane-mark ;
+    move-caret f swap set-pane-mark ;
 
 : extend-selection ( pane -- )
     hand-moved? [
         dup selecting?>> [
-            dup move-caret
+            move-caret
         ] [
             dup hand-clicked get child? [
                 t >>selecting?
                 dup hand-clicked set-global
-                dup move-caret
-                dup caret>mark
+                move-caret
+                caret>mark
             ] when
         ] if
         dup dup pane-caret gadget-at-path scroll>gadget

        2drop
    ] if ;

: caret>mark ( pane -- )
    dup pane-caret over set-pane-mark relayout-1 ;

GENERIC: sloppy-pick-up* ( loc gadget -- n )



TUPLE: pane-control < pane quot ;

M: pane-control model-changed ( model pane-control -- )
   [ value>> ] [ dup quot>> ] bi* with-pane ;

: <pane-control> ( model quot -- pane )
    pane-control new-pane
