resession.nvim
resession.nvim copied to clipboard
bug: g; and <C-o> do not jump after restoring session
Did you check the docs and existing issues?
- [X] I have read the docs
- [X] I have searched the existing issues
Neovim version (nvim -v)
0.10.0 and nightly
Operating system/version
Almalinux with NIX
Describe the bug
:jumps are not restored. The current item > in :changes is always set to the first item.
What is the severity of this bug?
breaking (some functionality is broken)
Steps To Reproduce
- Open a file.
- Edit the file. Jump with
{}a little. - Confirm there is something in
:jumpsand:changes:. -
:lua require'resession'.save(vim.fn.getcwd(), {dir="dirsession"}) - Close nvim.
- Open nvim.
-
:lua require'resession'.load(vim.fn.getcwd(), {dir="dirsession"}) - Notice
:jumpsare missing. - Notice that in
:changes:the current>is set as the first item, not after-the-last item as it should be.
Expected Behavior
I am in the process of moving from vim-workspace to resession. My expected behavior is that session saves changes and jumps. I couldn't find documentation about it. Is it expected?
Thanks for making resession, it's great!
Directory structure
repro.lua test.txt
Repro
-- save as repro.lua
-- run with nvim -u repro.lua
-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "runtime", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
{
"stevearc/resession.nvim",
config = function()
require("resession").setup({
-- add any needed settings here
})
end,
},
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
Did you check the bug with a clean config?
- [X] I have confirmed that the bug reproduces with
nvim -u repro.luausing the repro.lua file above.
As far as I'm aware, there's no API for getting or setting jumps, so I don't think there's any way for resession to save and restore that state.