1. KISS :: word auto-complete from pick list
- Posted by K_D_R Apr 20, 2013
- 1077 views
Works like a charm!
-- -- edx.ex 1.3 -- -- user enters a partial "word" of any length -- such as: "db_" then enters ESCAPE + 'a' -- UP/DOWN arrow keys are used to scroll through -- a pick list. Pressing enter selects the completion -- word. -- -- library = all euphoria std library keywords -- plus EuGTK or WxEu library keywords. GUI -- libraries can be loaded or dumped at will -- elsif command[1] = 'a' then -- auto complete word pattern = search_word & '*' for i = 1 to length(library) do status = is_match(pattern, library[i]) if status then auto_complete = append(auto_complete, library[i]) end if end for if length(auto_complete)>=1 then set_top_line("select word: ") command = trim_tail(key_gets("", auto_complete)) add_queue((repeat(BS,length(search_word)) & command)) end if