feat: add some new items and make mappings easier

This commit is contained in:
TJ DeVries
2020-09-02 00:06:03 -04:00
parent 9f906f0392
commit 061307233c
8 changed files with 242 additions and 43 deletions

View File

@@ -78,5 +78,23 @@ actions.close = function(prompt_bufnr)
vim.cmd(string.format([[bwipeout! %s]], prompt_bufnr))
end
actions.set_command_line = function(prompt_bufnr)
local entry = actions.get_selected_entry(prompt_bufnr)
actions.close(prompt_bufnr)
vim.cmd(entry.value)
end
-- TODO: Think about how to do this.
actions.insert_value = function(prompt_bufnr)
local entry = actions.get_selected_entry(prompt_bufnr)
vim.schedule(function()
actions.close(prompt_bufnr)
end)
return entry.value
end
return actions