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: do not auto clean up buffers after session restore, unless opted in #779

Conversation

cseickel
Copy link
Contributor

fixes #778

This moves the session cleanup functionality to an opt-in feature instead of enabling it automatically for everyone.

The new config option is:

  auto_clean_after_session_restore = false, -- Automatically clean up broken neo-tree buffers saved in sessions

I also moved the first cleanup action from the renderer to the setup function.

@cseickel
Copy link
Contributor Author

@nhat-vo Can you test this out and confirm it still works as expected when you opt-in to the functionality by setting auto_clean_after_session_restore = false, in your config?

Also, let me know if you think that is a good name for the config option.

@nhat-vo
Copy link
Collaborator

nhat-vo commented Mar 1, 2023

@cseickel looks good to me. Thanks a lot for adding the fix! I just want to note, though, that #771 should make neo-tree clean only invalid buffers. Anyway, as there has been quite a few issues regarding this, I think it would be wise to set this option to avoid any further problems.

@cseickel
Copy link
Contributor Author

cseickel commented Mar 1, 2023

Thanks for confirming @nhat-vo.

After thinking about this, I realize that any new functionality needs to be opt-in because you never now how it may interact with all of the different setups people have, especially when doing something like deleting buffers with an autocmd. Even if the default value is eventually true, you still need an escape hatch for people to be able to disable it when they need to.

@cseickel cseickel merged commit aec592b into main Mar 1, 2023
@cseickel cseickel deleted the 778-automatic-buffer-cleaning-after-session-restore-should-be-opt-in branch July 15, 2023 02:28
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