Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass opts to actions.preview #497

Merged
merged 3 commits into from
Oct 25, 2024
Merged

fix: pass opts to actions.preview #497

merged 3 commits into from
Oct 25, 2024

Conversation

vex9z7
Copy link
Contributor

@vex9z7 vex9z7 commented Oct 24, 2024

It looks like an unintened mistake to not pass the opts to the callback, because without it, the preview window cannot be a horizontal split.

Copy link
Owner

@stevearc stevearc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will also want to add a parameters table to the preview action, like the other actions that accept options. Example:

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",
},
tab = {
type = "boolean",
desc = "Open the buffer in a new tab",
},
close = {
type = "boolean",
desc = "Close the original oil buffer once selection is made",
},
},

@stevearc
Copy link
Owner

Thanks for the PR!

@stevearc stevearc merged commit cca1631 into stevearc:master Oct 25, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants