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

feat: auto-quit vim if oil is closed as last buffer #491

Merged
merged 8 commits into from
Nov 21, 2024

Conversation

cdmill
Copy link
Contributor

@cdmill cdmill commented Oct 8, 2024

Added a simple feature that will auto-quit vim if oil is closed and there are no other buffers open. I added an option to config.lua to opt-in to this behavior.

@github-actions github-actions bot requested a review from stevearc October 8, 2024 23:04
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.

I think this is a fine customization, but it should be done by passing in options to the function rather than a config option. The oil.close function should take an option table with something like close_if_last_buf as the parameter. Then the close action should be reworked to accept the same options, similar to how actions.cd accepts options.

@github-actions github-actions bot requested a review from stevearc October 17, 2024 01:09
Copy link
Contributor Author

@cdmill cdmill left a comment

Choose a reason for hiding this comment

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

I chose exit_if_last_buf to make it more clear that it is separate from oil.close but if you prefer 'quit' or 'close' than I can resubmit!

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.

Just a couple nits left

lua/oil/init.lua Outdated Show resolved Hide resolved
lua/oil/config.lua Outdated Show resolved Hide resolved
@github-actions github-actions bot requested a review from stevearc October 17, 2024 01:37
@cdmill
Copy link
Contributor Author

cdmill commented Nov 20, 2024

Any update on this?

@stevearc
Copy link
Owner

LGTM!

@stevearc stevearc merged commit 81cc9c3 into stevearc:master Nov 21, 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