feat(file-popup): add actions.file_popup.open_win_config

* file-popup: add nvim_open_win configuration

* docs: update file-popup configuration
This commit is contained in:
Hoang Nguyen
2022-08-08 00:52:14 +00:00
committed by GitHub
parent ff6e7966f3
commit a73d0d4800
4 changed files with 41 additions and 6 deletions

View File

@@ -28,16 +28,12 @@ local function setup_window(node)
local max_width = vim.fn.max(vim.tbl_map(function(n)
return #n
end, lines))
local winnr = a.nvim_open_win(0, false, {
col = 1,
row = 1,
relative = "cursor",
local open_win_config = vim.tbl_extend("force", M.open_win_config, {
width = max_width + 1,
height = #lines,
border = "shadow",
noautocmd = true,
style = "minimal",
})
local winnr = a.nvim_open_win(0, false, open_win_config)
current_popup = {
winnr = winnr,
file_path = node.absolute_path,
@@ -78,4 +74,8 @@ function M.toggle_file_info(node)
})
end
function M.setup(opts)
M.open_win_config = opts.actions.file_popup.open_win_config
end
return M