Closed dsully closed 9 months ago
how is the session saved? and how is it restored?
I'm using stevearc/resession.nvim
which doesn't use mksession
- though I saw this behavior with mksession
as well.
https://github.com/dsully/nvim/blob/main/lua/plugins/session.lua
This is what is saved:
{
"buffers": [
{
"name": "/Users/dsully/.config/nvim/lua/plugins/init.lua",
"last_pos": [38, 26],
"options": {
"filetype": "lua",
"bufhidden": "",
"modifiable": true,
"binary": false,
"readonly": false,
"buflisted": true
},
"loaded": true
}
],
"quickfix": [],
"tab_scoped": false,
"tabs": [
{
"options": {
"cmdheight": 0
},
"wins": [
"leaf",
{
"cursor": [38, 26],
"bufname": "/Users/dsully/.config/nvim/lua/plugins/init.lua",
"current": true,
"height": 54,
"options": {
"winfixheight": false,
"diff": false,
"previewwindow": false,
"scrollbind": false,
"winfixwidth": false
},
"width": 171
}
]
}
],
"global": {
"options": {
"cmdheight": 0
},
"height": 55,
"width": 171,
"cwd": "/Users/dsully/.config/nvim"
}
}
If I run mksession
manually, then: nvim -S
I get this error:
E5108: Error executing lua [string "v:lua"]:1: attempt to call global 'nougat_core_generator_fn' (a nil value)
stack traceback:
[string "v:lua"]:1: in main chunk
In Session.vim
:
$ grep statusline Session.vim
set statusline=%!v:lua.nougat_core_generator_fn(1)
setlocal statusline=
What's the output for :lua= vim.o.sessionoptions
? 🤔
If I run mksession manually, then: nvim -S I get this error:
This happens if sessionoptions
has options
. You cannot do set statusline=%!v:lua.nougat_core_generator_fn(1)
before the plugin is loaded.
You're getting
attempt to call global 'nougat_core_generator_fn' (a nil value)
because when statusline
option is being set, nougat.nvim
is not loaded yet.
Ok - that explains mksession
. Any thoughts on stevearc/resession.nvim
usage?
I couldn't reproduce it with ressession.nvim. If you can provide a minimal config I can use to reproduce the issue, that would be helpful.
(You can create a new bug report, you'll find the template for minimal config when creating the new issue.)
Got it sorted. I had an autocmd to hide the statusline when using alpha-nvim
, but not to unhide it on BufUnload
.
What information would be helpful to debug?