 : table-button-down ( table -- ) [ (select-row) ] swap (table-button-down) ;
 : continued-button-down ( table -- ) dup multiple-selection?>> [ [ add-selected-row ] swap (table-button-down) ] [ table-button-down ] if ;
 : thru-button-down ( table -- ) dup multiple-selection?>> [
-    [ over selected-index>> (a,b] over
-      [ swap push-selected-index drop ] curry each continued-button-down ]
+    [ 2dup over selected-index>> (a,b) swap
+      [ swap push-selected-index drop ] curry each add-selected-row ]
     swap (table-button-down) ] [ table-button-down ] if ;
 
 PRIVATE>

    { mouse-enter show-mouse-help }
    { mouse-leave hide-mouse-help }
    { motion show-mouse-help }
    { T{ button-down f { A+ } 1 } continued-button-down }
    { T{ button-down f { S+ } 1 } thru-button-down }
    { T{ button-down } table-button-down }
    { T{ button-up } table-button-up }
    { gain-focus focus-table }
    { lose-focus unfocus-table }
    { T{ drag } table-button-down }

M: table (>>selected-index) [ 1vector ] dip (>>selected-indices) ;

IN: ui.gadgets.tables
: push-selected-index ( table n -- table ) 2dup swap selected-indices>> index [ drop ] [ over selected-indices>> push ] if ;

: new-table ( rows renderer class -- table )
    new-line-gadget
