-- Use Vim packages install the plugin, also work with some plugins manager such as packer.nvim
vim.o.packpath = '~/.local/share/nvim/site'
vim.cmd('packadd promise-async')
vim.cmd('packadd nvim-ufo')
vim.cmd('packadd auto-session')
-- Setting
vim.o.foldcolumn = '1'
vim.o.foldlevel = 99
vim.o.foldlevelstart = -1
vim.o.foldenable = true
local ufo = require('ufo')
ufo.setup()
vim.keymap.set('n', 'zR', ufo.openAllFolds)
vim.keymap.set('n', 'zM', ufo.closeAllFolds)
require('auto-session').setup()
nvim --clean -u mini.lua
Open nvim in a directory and open some files in nvim
Close nvim with some files open (this will create the session on vim leave)
Reopen neovim in the same directory, see error
...
Expected behavior
Since the most recent commit, 8cf1259 when I re-open neovim with a session autoloaded using the https://github.com/rmagatti/auto-session plugin. I encounter the bug described below about the invalid buffer id: 1 I think when restarting a session, some buffers are deleted really quickly before the session restarts.
Actual behavior
Error executing vim.schedule lua callback: UnhandledPromiseRejection with the reason:
...site/pack/packer/start/nvim-ufo/lua/ufo/model/buffer.lua:17: Invalid buffer id: 1
Neovim version (nvim -v | head -n1)
NVIM v0.8.0-dev+2060-g0f1b17788
Operating system/version
macOS 12.4
How to reproduce the issue
cat mini.lua
nvim --clean -u mini.lua
Expected behavior
Since the most recent commit, 8cf1259 when I re-open neovim with a session autoloaded using the https://github.com/rmagatti/auto-session plugin. I encounter the bug described below about the
invalid buffer id: 1
I think when restarting a session, some buffers are deleted really quickly before the session restarts.Actual behavior