rmagatti / auto-session

A small automated session manager for Neovim
MIT License
1.21k stars 49 forks source link

Doesn't save window splits #329

Closed raffaem closed 2 months ago

raffaem commented 2 months ago

This doesn't seem to save window splits.

Am I missing something?

rmagatti commented 2 months ago

Sorry, not sure what you mean

raffaem commented 2 months ago

If you do a window split (e.g. with :vsplit), the split is not saved

cameronr commented 2 months ago

@raffaem It should be saving window sizes.

Can you share your auto-session config and the value of vim.o.sessionoptions?

raffaem commented 2 months ago
return {
  {
    'rmagatti/auto-session',
    dependencies = {
      'nvim-telescope/telescope.nvim', -- Only needed if you want to use sesssion lens
    },
    config = function()
      require('auto-session').setup({
        auto_session_suppress_dirs = { '~/', '~/Projects', '~/Downloads', '/' },
      })
    end,
  },
}
:lua =vim.o.sessionoptions                                                                                                               
blank,buffers,curdir,folds,help,tabpages,winsize,terminal,globals
cameronr commented 2 months ago

That should work so there must be something else going on. Can you see if this minimal config works correctly for you:

--[[ Minimal config to reproduce issues ]]
--
--  Usage: `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", "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)

vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,terminal,globals"

-- install plugins
local plugins = {
    -- add any other plugins here
    {
        "rmagatti/auto-session",
        lazy = false, -- Needs to restore session on Neovim start.
        config = true,
    },
}
require("lazy").setup(plugins, {
    root = root .. "/plugins",
})

Can you describe more about your environment? What version of nvim are you using?

raffaem commented 2 months ago

It is working now, my bad.

Sorry for that.