feat: Allow overriding actions from mappings (#248)

This commit is contained in:
TJ DeVries
2020-11-16 10:58:30 -05:00
committed by GitHub
parent ad7280e0b9
commit 985856946e
6 changed files with 301 additions and 58 deletions

View File

@@ -61,6 +61,9 @@ function Picker:new(opts)
error("layout_strategy and get_window_options are not compatible keys")
end
-- Reset actions for any replaced / enhanced actions.
actions._clear()
local layout_strategy = get_default(opts.layout_strategy, config.values.layout_strategy)
return setmetatable({
@@ -708,6 +711,8 @@ function Picker:set_selection(row)
local status = state.get_status(self.prompt_bufnr)
local results_bufnr = status.results_bufnr
state.set_global_key("selected_entry", entry)
if not vim.api.nvim_buf_is_valid(results_bufnr) then
return
end