Closed arcxio closed 3 months ago
Thanks for the suggestion!
My initial feeling is that this will over-complicate 'mini.sessions'. But I'll think about it.
Sorry, I think supporting custom autoreading logic beyond what currently is possible is a bit too much for 'mini.sessions'.
Exporting is_something_shown()
in 'mini.misc' means duplicating it third time in 'mini.nvim' for not a lot of benefit. It is also not that complicated function to implement from scratch.
Closing as not planned.
It is also not that complicated function to implement from scratch.
that's fair. I ended up leaving just the first line of is_something_shown (if vim.fn.argc() > 0 then return end
) in autoread and found it sufficient.
duplicating it third time in 'mini.nvim'
by the way, on that note, is_something_shown in sessions and starter have reversed order of conditionals. is that intentional? I thought starter's order makes more sense (from a more simple check to a more complicated check)
by the way, on that note, is_something_shown in sessions and starter have reversed order of conditionals. is that intentional? I thought starter's order makes more sense (from a more simple check to a more complicated check)
No, I don't think so. They probably should be the same. I'll look into it.
Thanks for noticing!
Edit: They are now the same on the main
branch.
Contributing guidelines
Module(s)
mini.sessions,mini.misc
Description
I have a project-based sessions workflow, meaning I use sessions based on
MiniMisc.find_root()
. Implementing my own autowrite is trivial, but autoread - less so, the main problem being checking if something is shown, which is implemented in a default autoread but hidden as a helper function. So I have to rely on a copy ofH.is_something_shown()
in my config just so I can autoread a session with the name I supply. Here's how the whole setup looks:I feel like making a custom sessions autoread should be more straightforward, but I'm not sure what the best solution for that would be. I can come up with two:
is_something_is_shown()
, probably in 'mini.misc'.