-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Error: Cannot close last window #308
Comments
Ah I see. One of the latest features (closing unsupported windows) doesn't seem to account for this scenario. 👍 |
Second this. My case is inconsistent. Sometimes it throws an error, and sometimes it doesn't. When it throws an error, Neovim either crashes and stuck (This only happened twice today, and that was how I knew the error came from auto-session); or Neovim exits successfully without even letting me check the error. All I did was enter Neovim and then exit it right after (No edit or anything) My setup for auto-session return {
"rmagatti/auto-session", -- This plugin is for restoring session from our last work period
config = function()
local auto_session = require("auto-session")
auto_session.setup({
auto_restore_enabled = false,
auto_session_suppress_dirs = { "~/", "~/Downloads", "~/Documents", "~/Desktop/" },
})
local keymap = vim.keymap
keymap.set("n", "<leader>wr", "<cmd>SessionRestore<CR>", { desc = "Restore session for cwd" }) -- restore last workspace session for current directory
keymap.set("n", "<leader>ws", "<cmd>SessionSave<CR>", { desc = "Save session for auto session root dir" }) -- save workspace session for current working directory
end,
} Specifically, the error is at this code snippet. vim.api.nvim_create_autocmd({ "VimLeavePre" }, {
group = group,
pattern = "*",
callback = function()
if not vim.g.in_pager_mode then
AutoSession.AutoSaveSession()
end
end,
}) |
Thank you guys for having a look. 🙏 In the meantime I have resorted to setting |
i have a fix that wraps |
Should be fixed with @cameronr's PR. Thanks, you've been a big help! |
Can confirm the error when using |
Describe the bug
Whenever I start neovim in my home folder and try to switch to a session with session-lens, I get the following error
To Reproduce
Steps to reproduce the behavior:
/home/username
cd-ing to the folder of a saved session and opening neovim there works as expected, also from there switching with session-lens works. It is only when I open neovim in my user home that switching via session-lens does not work.
Expected behavior
auto-session opens the saved session chosen via session-lens
Baseline (please complete the following information):
Result of
set sessionoptions?
:OS.
e.guname -a
neofetch
:nvim --version
https://github.com/yetyetanotherusername/nvim
The text was updated successfully, but these errors were encountered: