diff --git a/extra/ui/tools/search/search.factor b/extra/ui/tools/search/search.factor index 1d8f16de5a..0a8fe92762 100755 --- a/extra/ui/tools/search/search.factor +++ b/extra/ui/tools/search/search.factor @@ -47,12 +47,12 @@ search-field H{ { T{ key-down f f "RET" } [ find-search-list invoke-value-action ] } } set-gestures -: ( producer -- model ) - >r g live-search-field gadget-model +: ( live-search producer -- live-search filter ) + >r dup field>> model>> ! live-search model :: producer ui-running? [ 1/5 seconds ] when [ "\n" join ] r> append ; -: ( seq limited? presenter -- gadget ) +: ( live-search seq limited? presenter -- live-search list ) >r [ limited-completions ] [ completions ] ? curry @@ -60,14 +60,15 @@ search-field H{ swap ; : ( string seq limited? presenter -- gadget ) - { 0 1 } live-search new-track - [ - g-> set-live-search-field f track, - g-> set-live-search-list - 1 track, - ] make-gadget - [ live-search-field set-editor-string ] keep - [ live-search-field end-of-document ] keep ; + { 0 1 } live-search new-track + >>field + dup field>> f track-add* + -roll >>list + dup list>> 1 track-add* + + swap + over field>> set-editor-string + dup field>> end-of-document ; M: live-search focusable-child* live-search-field ;