stevearc / resession.nvim

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

Error and session load aborts when session loads files with swap files #8

Closed rish987 closed 1 year ago

rish987 commented 1 year ago

This plugin (esp. the custom filter and auto-save functionality) has been a lifesaver w.r.t. an issue I've been seeing in another plugin (see Julian/lean.nvim#289) where nvim freezes and has to be killed. In this situation, however, you're often left with swap files that you would like to restore. Currently, trying to load a session where some buffers have swap files results in a lua error and the session load is aborted. See the test at rish987/resession.nvim@e80b556311c6684aa097f078bc902b00308a1929.

This is because currently, the unprotected call to vim.fn.bufload in resession.load means that any error there will make function exit. This should be fixable by guarding it with a pcall.

rish987 commented 1 year ago

Closed by #10.