stevearc / resession.nvim

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

feature request: add api to check if session with name exists #61

Open Kamilcuk opened 3 weeks ago

Kamilcuk commented 3 weeks ago

Did you check existing requests?

Describe the feature

Would be great to have a require"resession".has(vim.fn.getcwd(), {dir = "dirsession"}) api for checking if a session named vim.fn.getcwd() exists. The list() is great, but the session name has replaced path separator and : by _, so there is nothing meaningful to do with list.

Alternatively, the function get_session_file could be exposed as public api.

Provide background

I am trying to check if session exists before loading it.

What is the significance of this feature?

nice to have

Additional details

No response

stevearc commented 2 weeks ago

I think a PR to add an exists() method would be reasonable