Fix listener word completion

db4
Slava Pestov 2008-05-07 03:28:53 -05:00
parent 8065f8834e
commit 6464a620cd
1 changed files with 6 additions and 7 deletions
extra/ui/tools/listener

View File

@ -7,7 +7,7 @@ ui.gadgets ui.gadgets.editors ui.gadgets.labelled
ui.gadgets.panes ui.gadgets.buttons ui.gadgets.scrollers ui.gadgets.panes ui.gadgets.buttons ui.gadgets.scrollers
ui.gadgets.tracks ui.gestures ui.operations vocabs words ui.gadgets.tracks ui.gestures ui.operations vocabs words
prettyprint listener debugger threads boxes concurrency.flags prettyprint listener debugger threads boxes concurrency.flags
math arrays generic accessors combinators ; math arrays generic accessors combinators assocs ;
IN: ui.tools.listener IN: ui.tools.listener
TUPLE: listener-gadget input output stack ; TUPLE: listener-gadget input output stack ;
@ -101,12 +101,11 @@ M: engine-word word-completion-string
"engine-generic" word-prop word-completion-string ; "engine-generic" word-prop word-completion-string ;
: use-if-necessary ( word seq -- ) : use-if-necessary ( word seq -- )
>r word-vocabulary vocab-words r> over word-vocabulary [
{ 2dup assoc-stack pick = [ 2drop ] [
{ [ dup not ] [ 2drop ] } >r word-vocabulary vocab-words r> push
{ [ 2dup memq? ] [ 2drop ] } ] if
[ push ] ] [ 2drop ] if ;
} cond ;
: insert-word ( word -- ) : insert-word ( word -- )
get-workspace workspace-listener input>> get-workspace workspace-listener input>>