mirror of
				https://github.com/wting/autojump
				synced 2025-06-13 12:54:07 +00:00 
			
		
		
		
	add completion support
This commit is contained in:
		
							parent
							
								
									de939863be
								
							
						
					
					
						commit
						7a756aaa4e
					
				| @ -6,3 +6,15 @@ function autojump_add_to_database() | |||||||
| end | end | ||||||
| 
 | 
 | ||||||
| clink.prompt.register_filter(autojump_add_to_database, 99) | clink.prompt.register_filter(autojump_add_to_database, 99) | ||||||
|  | 
 | ||||||
|  | function autojump_completion(word) | ||||||
|  |   for line in io.popen("python " .. AUTOJUMP_BIN .. " --complete " .. word):lines() do | ||||||
|  |     clink.add_match(line) | ||||||
|  |   end | ||||||
|  |   return {}  | ||||||
|  | end | ||||||
|  | 
 | ||||||
|  | local autojump_parser = clink.arg.new_parser() | ||||||
|  | autojump_parser:set_arguments({ autojump_completion }) | ||||||
|  | 
 | ||||||
|  | clink.arg.register_parser("j", autojump_parser) | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user