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

bug: g; and <C-o> do not jump after restoring session #60

Open
3 tasks done
Kamilcuk opened this issue Jun 14, 2024 · 1 comment
Open
3 tasks done

bug: g; and <C-o> do not jump after restoring session #60

Kamilcuk opened this issue Jun 14, 2024 · 1 comment
Labels
bug Something isn't working P2 Not a priority. PRs welcome

Comments

@Kamilcuk
Copy link

Did you check the docs and existing issues?

  • I have read the docs
  • 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

  1. Open a file.
  2. Edit the file. Jump with { } a little.
  3. Confirm there is something in :jumps and :changes:.
  4. :lua require'resession'.save(vim.fn.getcwd(), {dir="dirsession"})
  5. Close nvim.
  6. Open nvim.
  7. :lua require'resession'.load(vim.fn.getcwd(), {dir="dirsession"})
  8. Notice :jumps are missing.
  9. 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?

  • I have confirmed that the bug reproduces with nvim -u repro.lua using the repro.lua file above.
@Kamilcuk Kamilcuk added the bug Something isn't working label Jun 14, 2024
@Kamilcuk Kamilcuk changed the title bug: g; does not jump after restoring session bug: g; and <C-o> do not jump after restoring session Jun 14, 2024
@stevearc
Copy link
Owner

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.

@stevearc stevearc added the P2 Not a priority. PRs welcome label Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 Not a priority. PRs welcome
Projects
None yet
Development

No branches or pull requests

2 participants