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

Load session lost syntax #67

Open
sphynx79 opened this issue Nov 12, 2021 · 0 comments
Open

Load session lost syntax #67

sphynx79 opened this issue Nov 12, 2021 · 0 comments

Comments

@sphynx79
Copy link

I use this plugin perfectly, but when i try use with auto-session plugin, reload session broke Vimade visualization
This is my sessionoptions:

vim.opt.sessionoptions = { "blank", "buffers", "curdir", "folds", "help", "tabpages", "winsize", "resize", "winpos", "terminal" }

and this is my configuration:

vim.g.vimade = {
  fadelevel = 0.6,
  usecursorhold = 1,
  enabletreesitter = 1,
  enablesigns = 1
}

require("util").define_augroups {
  _vimade = {
    {
      "FileType",
      "nerdtree,vista,neoterm,dapui_scopes,dapui_breakpoints",
      "VimadeBufDisable",
    },
  }
}
local M = {}

local function closeNerdTree()
  if (vim.api.nvim_call_function('exists', {"t:NERDTreeBufName"}) == 1 and vim.fn.bufwinnr(vim.t.NERDTreeBufName) ~= -1) then
    vim.cmd([[NERDTreeClose]])
  end
  vim.cmd([[VimadeDisable]])
end

local function enableVimade()
  vim.cmd([[VimadeEnable]])
end

local opts = {
  auto_session_enabled = true,
  auto_save_enabled = false,
  auto_restore_enabled = false,
  pre_save_cmds = { closeNerdTree },
  post_save_cmds = { enableVimade }
}


function M.setup()
  require('auto-session').setup(opts)
end

return M
4fBLJdzaV6.mp4
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

1 participant