1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

add completion support

This commit is contained in:
Michael Lawson 2014-01-15 13:05:45 +00:00
parent de939863be
commit 7a756aaa4e

View File

@ -6,3 +6,15 @@ function autojump_add_to_database()
end
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)