stevearc / resession.nvim

A replacement for mksession with a better API
MIT License
221 stars 15 forks source link

Options not restored across tabs #7

Closed mehalter closed 1 year ago

mehalter commented 1 year ago

I have noticed that when I restore a multi-tab session the options are not restored to every tab that is created. Things like cmdheight are only fully restored in the tab that ends up getting focused and not the other tabs. I think this is because things like vim.opt.cmdheight are tab scoped and need to be restored each time.

stevearc commented 1 year ago

Wow I missed that! From the docs:

Currently there is only one option local to a tab page: 'cmdheight'.

I'll fix that. Have you noticed this happening with anything else, or just cmdheight?

mehalter commented 1 year ago

Thanks so much! Also, I have only noticed it for cmdheght.

stevearc commented 1 year ago

I believe I've fixed the issue, but please confirm. This was a bit hacky because there's not good support for tab-local options in the lua API.

Also, I just put in a performance optimization of disabling most autocmds during save & load. LMK if that causes any odd behavior for you.

mehalter commented 1 year ago

Just tested this @stevearc and it seems to be working as intended with the tab restore stuff. I will keep an eye out for weird behavior moving forward, but I will go ahead and close this issue since the topic of this one seems to be resolved. That way I can re-open if something weird comes up or if I find new weird behavior I can open a new issue.

Thanks again for the quick response, investigation, and fix!