KISS :: word auto-complete from pick list

new topic     » topic index » view thread      » older message » newer message

Works like a charm! smile smile smile

-- 
-- 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 
new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu