dhruvasagar / vim-prosession

Handle vim sessions like a pro
254 stars 22 forks source link

Unable to delete the session file if the folder is removed #92

Closed eight04 closed 2 years ago

eight04 commented 2 years ago

After creating a session file and removing the folder, :ProsessionDelete will throw an Directory ... does not exist error.

Maybe :ProsessionDelete should suppress the error and delete the session file.

dhruvasagar commented 2 years ago

@eight04 Why would you attempt to call ProsessionDelete when the directory no longer exists ?

dhruvasagar commented 2 years ago

@eight04 Also, the most appropriate action here is just calling :Obsession!

eight04 commented 2 years ago

Why would you attempt to call ProsessionDelete when the directory no longer exists ?

Because you can still see that item in prosession#ListSessions. The major problem is that it also affect prosession#ProsessionComplete and I get lots of invalid entries when completing the :Prosession command.

the most appropriate action here is just calling :Obsession!

:Obsession! can only work with the current session. It doesn't work for session files (in g:prosession_dir) which are not activated.

dhruvasagar commented 2 years ago

@eight04 Alright that makes sense, what about a :ProsessionClean instead to delete invalid session files ?

dhruvasagar commented 2 years ago

@eight04 Added the command :ProsessionClean