stevearc / resession.nvim

A replacement for mksession with a better API
MIT License
175 stars 13 forks source link

feat: allow consecutive deletion of sessions #24

Closed Subjective closed 10 months ago

Subjective commented 10 months ago

More often than not, a user will want to delete multiple sessions simultaneously (in my experience). For these situations, it makes sense to prompt the user again after sucessfully deleting a session, rather than having them repeatedly call the delete function.

Other ideas: Maybe there's a way to leverage telescope's multiselect and delete all of them simultaneously, or an optional argument could be passed in enable the repeated deletion prompt, though both of these would add complexity to the api and implementation.

stevearc commented 10 months ago

While I agree it would be a nice-to-have to easily enable multiple selection+deletion, the tools aren't available for it right now. The correct way for this to work would be for vim.ui.select to add API configuration for multi-selection. Until then, the APIs exist for this but the end user will have to put it together themselves. For example, nothing is stopping you from doing dressing.list(), opening a telescope multi-select, and then passing the results to dressing.delete().

This PR is not the right way to solve the problem. This means that previously a purely noninteractive API call (dressing.delete("mysession")) will now open a UI selector afterwards.