diff --git a/basis/ui/gadgets/tables/tables.factor b/basis/ui/gadgets/tables/tables.factor index b08e4566f3..e54d219ba6 100644 --- a/basis/ui/gadgets/tables/tables.factor +++ b/basis/ui/gadgets/tables/tables.factor @@ -107,7 +107,8 @@ M: table layout* 0 [ table-gap + + ] accumulate nip ; : column-line-offsets ( table -- xs ) - column-offsets rest-slice [ table-gap 2/ - ] map ; + column-offsets + [ f ] [ rest-slice [ table-gap 2/ - ] map ] if-empty ; : draw-columns ( table -- ) [ column-line-color>> gl-color ] diff --git a/basis/ui/tools/listener/listener.factor b/basis/ui/tools/listener/listener.factor index ef4d249734..f121347857 100644 --- a/basis/ui/tools/listener/listener.factor +++ b/basis/ui/tools/listener/listener.factor @@ -435,7 +435,8 @@ M: listener-gadget ungraft* ! Foo USING: summary ui.gadgets.labels ui.gadgets.tables colors ui.render -ui.gadgets.worlds ui.gadgets.glass tools.completion ui.gadgets ; +ui.gadgets.worlds ui.gadgets.glass tools.completion ui.gadgets +present ; USE: tools.completion : ( model -- gadget ) @@ -447,12 +448,12 @@ TUPLE: completion-popup < wrapper table interactor ; [ completion-popup? ] find-parent ; SINGLETON: completion-renderer -M: completion-renderer row-columns drop name>> 1array ; +M: completion-renderer row-columns drop present 1array ; M: completion-renderer row-value drop ; : ( object object -- object ) [ one-word-elt 1/3 seconds ] dip - '[ [ { } ] [ @ keys 20 short head ] if-empty ] ; + '[ @ keys 1000 short head ] ; : hide-completion-popup ( popup -- ) interactor>> f >>completion-popup find-world hide-glass ; @@ -500,9 +501,11 @@ completion-popup H{ [ vocabs-matching ] [ words-matching ] ? show-completion-popup ; +: history-matching ( string interactor -- alist ) + history>> dup zip completions ; + : history-completion-popup ( interactor -- ) - dup '[ _ history>> dup zip completions ] - show-completion-popup ; + dup '[ _ history-matching ] show-completion-popup ; : pass-to-popup? ( gesture interactor -- ? ) [ [ key-down? ] [ key-up? ] bi or ]