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

[Feature Request]: Add global to vim.o.sessionoptions automatically (if persist_buffer_sort is True) #969

Open
richardso21 opened this issue Oct 15, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@richardso21
Copy link

What?

If persist_buffer_sort == true, then before setting up the auto command we should also check to see that global is in sessionoptions. If not, we should insert it.

This also brings up the edge case where pinned buffers won't persist if persist_buffer_sort == false. In that case, we can make this functionality togglable as well and insert global if either one is true as specified in the config table.

We could also just ignore all of this and insert global into session options during plugin setup, regardless of the config options.

Why?

There are already multiple issues in the past (#660, #649) where people have forgot to add global into session options. I admit that it took me a while to pinpoint this problem as well, and technically this is written in the help/doc file at the end of the section. However, the readme file implied that buffer order persists out-of-the-box, yet that's not entirely the case. I personally care about the ordering of my buffers (that's why I chose this plugin in the first place), so I think setting sessionoptions within the plugin would prevent future users from struggling with this.

If it's decided that no code changes would result from this issue, I suggest at least moving the disclaimer to the README just so others see this more clearly.

Thanks!

@richardso21 richardso21 added the enhancement New feature or request label Oct 15, 2024
@akinsho
Copy link
Owner

akinsho commented Oct 15, 2024

@richardso21 I definitely definitely do not want this plugin affecting peoples session files for a bunch of reasons, not the least of which is the expected mountain of issues from people custom setups. Re. moving it to the README tbh I think the number of things that would warrant a mention exactly because it affects someone use case is pretty huge which lead to me having to rewrite the readme to move all such knowledge to the help docs anyway.

The README is a glitzy description of the plugin, not where people are supposed to look for detailed instructions on how it works

@richardso21
Copy link
Author

richardso21 commented Oct 15, 2024

Fair enough, I totally understand

The readme does mention this right below the Re-ordering section:

This order can be persisted between sessions (enabled by default).

I think adding something like "...(enabled by default, once you add globals to sessionoptions)" is minimal, yet helpful enough. Also, there are already a few places in the readme with NOTES, and I think a "gotcha" like this kinda fits as one of those. Finally, there's a caveats and FAQ section where we can probably put this in if nothing else works.

Ultimately, it's your plugin repo though 😅 (which is awesome btw). If you still think otherwise, I'm fine to close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants