From d4c82f8743c09ba95050811f1ebe8d098592bf31 Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@slava-pestovs-macbook-pro.local> Date: Mon, 12 Jan 2009 14:31:59 -0600 Subject: [PATCH] Working on context-sensitive completion --- basis/ui/tools/listener/listener.factor | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/basis/ui/tools/listener/listener.factor b/basis/ui/tools/listener/listener.factor index b526bfe9f3..9b08d0faae 100644 --- a/basis/ui/tools/listener/listener.factor +++ b/basis/ui/tools/listener/listener.factor @@ -416,7 +416,7 @@ 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 splitting ; USE: tools.completion : <summary-gadget> ( model -- gadget ) @@ -479,15 +479,15 @@ completion-popup H{ [ find-world ] dip { 0 0 } show-glass ; -: complete-IN:/USE:? ( object -- object ) +: complete-IN:/USE:? ( tokens -- ? ) 2 short tail* { "IN:" "USE:" } intersects? ; +: complete-USING:? ( tokens -- ? ) + { ";" } split1-last nip { "USING:" } intersects? ; + : vocab-completion? ( interactor -- ? ) [ editor-string ] [ editor-caret* ] bi head " " split - { - [ complete-IN:? ] - [ { ";" } last-split1 ] - } 1|| ; + { [ complete-IN:/USE:? ] [ complete-USING:? ] } 1|| ; : word-completion-popup ( interactor -- ) dup <word-completion-popup> (show-completion-popup) ;