axkirillov / hbac.nvim

Heuristic buffer auto-close
MIT License
197 stars 10 forks source link

fix: #27 error when sourcing session with more than threshold buffers #28

Closed cameronr closed 1 month ago

cameronr commented 1 month ago

vim.g.SessionLoad is set when loading a session, so we defer the buffer checking until it's unset (i.e. the session has been loaded)

An alternative fix might be to do some clever buffer sorting (where unnamed buffers are sorted to the front if a session is being loaded) but that seemed less ideal because you'd be left with threshold - 1 buffers after the session is loaded.

axkirillov commented 1 month ago

Hi! Thank you for your PR. Sorry for late reply, unfortunately right now I don't have time to look into it more, so I'm merging in the hopes that it just works 😅 . I have stoped using hbac a while ago, and have never used sessions so I am not familiar with the problem.