fix: actions.preview accepts options (#497)
* fix: pass opts to actions.preview * add opts type to action.preview * run generate.py script
This commit is contained in:
parent
28aca0c1f5
commit
cca1631d5e
2 changed files with 22 additions and 2 deletions
|
|
@ -69,7 +69,21 @@ M.select_tab = {
|
|||
|
||||
M.preview = {
|
||||
desc = "Open the entry under the cursor in a preview window, or close the preview window if already open",
|
||||
callback = function()
|
||||
parameters = {
|
||||
vertical = {
|
||||
type = "boolean",
|
||||
desc = "Open the buffer in a vertical split",
|
||||
},
|
||||
horizontal = {
|
||||
type = "boolean",
|
||||
desc = "Open the buffer in a horizontal split",
|
||||
},
|
||||
split = {
|
||||
type = '"aboveleft"|"belowright"|"topleft"|"botright"',
|
||||
desc = "Split modifier",
|
||||
},
|
||||
},
|
||||
callback = function(opts)
|
||||
local entry = oil.get_cursor_entry()
|
||||
if not entry then
|
||||
vim.notify("Could not find entry under cursor", vim.log.levels.ERROR)
|
||||
|
|
@ -88,7 +102,7 @@ M.preview = {
|
|||
return
|
||||
end
|
||||
end
|
||||
oil.open_preview()
|
||||
oil.open_preview(opts)
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue