gennaro-tedesco / nvim-possession

📌 the no-nonsense session manager
MIT License
215 stars 7 forks source link

The autoload setting makes the loaded buffer innactive #27

Closed I-Own-You closed 1 year ago

I-Own-You commented 1 year ago

Hello again! Another issue. I have 3, so ill open them apart for convenience.

When autoload = true in plugin setup, when i enter neovim and the session loads, the file that opens(whatever opens) is somehow innactive, doesnt have the colorscheme, lsp isnt working, so i assume its something related to lazy neovim, the keybinding are in plugins.lua and the setup config is a separate file that i load with init.lua

Keymaps: image

Setup config: image

Init.lua: image

One way to fix that i use :e and the buffer refreshes

gennaro-tedesco commented 1 year ago

This is certainly due to some lazy loading that you have for treesitter and lsp, which most likely load later on some specific events that aren't triggered yet when the session is sourced. Notice that in general nvim-possession does nothing except for providing an interface with fzf-lua and some sugar mechanisms to operate with sessions, it doesn't really change or do anything on its own: as such, the problems that you see when loading sessions via this plugin would most likely occur even if you would source the sessions manually by yourself. In turn, this implies that they are due to your specific lazy loading.

See here: autoload essentially sources the session and no more.

One way to fix that i use :e and the buffer refreshes

this is because :e manually re-parses the buffer, forcibly invoking treesitter again.

For reference have a look at my setup: here is my treesitter, here is my fzf-lua and here is nvim-possession. This setup does work :)