Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sessions not loading #43

Open
SlartThunder opened this issue Oct 25, 2024 · 8 comments
Open

Sessions not loading #43

SlartThunder opened this issue Oct 25, 2024 · 8 comments

Comments

@SlartThunder
Copy link

I just upgraded nvim version and packages:

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1727870382
Run "nvim -V1 -v" for more info

nvim-possession loaded using Lazy manager:

dir     ~/.local/share/nvim/lazy/nvim-possession
url     https://github.com/gennaro-tedesco/nvim-possession
version 0.0.14
tag     v0.0.14
branch  main
commit  0844f6d
readme  README.md
help    |possession.txt|

The issue is that nvim-possession does not load the sessions anymore as it should.
It displays the session as a buffer in neovim,, the ones located in ~/.local/share/nvim/sessions/

@gennaro-tedesco
Copy link
Owner

gennaro-tedesco commented Oct 25, 2024

Good evening, could you please indicate some steps to reproduce the issue, in particular the steps that you undertake to save the session first, and then loaded it afterwards (for instance are you loading the session automatically)?

It would also help if you could try to reproduce the problem using the minimal repro.lua (so that we exclude it is related to other external dependencies).

@SlartThunder
Copy link
Author

At first the sesions were coming from the older version, so I thought that maybe something broke and I deleted them to start a new fresh session.
At this point, I just created a test session with 2 buffers open in a vertical split and saved the session, exited from neovim.
When entering again, I listed the sessin sl and choose the only 1 existing at this point, howeverthe session was displayed rather than load.

Moreover, when I list the sessions, also a .DS_Store file is shown that it does not exist in location ~/.local/share/nvim/sessions/

And most interesting, it seems fzf-lua fails with this plugin. When I tried ctrl-g errors pop up

This is my nvim-possession setup:

    require("nvim-possession").setup({
	  autoswitch = { enable = true, },
	  autosave = false,
	  post_hook = require("nvim-possession-extension").set_mappings_again,
	  fzf_winopts = {
		  preview = {
			horizontal = "up:60%",
		  },
		}

@gennaro-tedesco
Copy link
Owner

And most interesting, it seems fzf-lua fails with this plugin. When I tried ctrl-g errors pop up

what is ctrl-g supposed to do here?

post_hook = require("nvim-possession-extension").set_mappings_again,

what are these require("nvim-possession-extension").set_mappings_again?

I presume the problem may lie in some keymappings that you use for fzf where enter doesn't select the list item to source but rather displays it in a buffer. Please try with the minimal repro because we need to isolate if this behaviour is generated by external keymaps (notice that with the minimal repro also fzf is configured minimally).

@SlartThunder
Copy link
Author

I found the issue… at least to me!

In nvim-possession/lua/nvim-possession/init.lua function M.list the actions array, rather than defining "enter" I switched to "default" to make it to work.

@gennaro-tedesco
Copy link
Owner

Yes, if I remember correctly this was a change introduced in fzf-lua some time ago.

Glad that you solved it: can I consider this closed?

@SlartThunder
Copy link
Author

IDK!
What should be the correct value for M.list actions? "default" or "enter"?
If I change the code on my box, I will have issues when upgrading the plugin…

@gennaro-tedesco
Copy link
Owner

As you can see from this commit the value was changed in the upstream fzf-lua to use "enter". Are you sure that your fzf-lua is updated to the latest?

@SlartThunder
Copy link
Author

Yes, fzf-lua is updated to the latest. See below image:
fzf-lua

Kind regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants