Closed Musinux closed 2 months ago
I've tried this with your minimal.lua file and can't recreate it. Is there something missing from your config?
Thanks for looking into it. I honestly don't know. Here's a session file that triggers the error consistenly. Maybe there's something in there that can help you?
The file is named: %home%musinux%projects%front-client@@branchprefix%the-branch-name.vim
let SessionLoad = 1
let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1
let v:this_session=expand("<sfile>:p")
silent only
silent tabonly
cd ~/projects/front-client
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
let s:wipebuf = bufnr('%')
endif
let s:shortmess_save = &shortmess
if &shortmess =~ 'A'
set shortmess=aoOA
else
set shortmess=aoO
endif
argglobal
%argdel
argglobal
enew
setlocal fdm=syntax
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=20
setlocal fml=1
setlocal fdn=20
setlocal fen
tabnext 1
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
silent exe 'bwipe ' . s:wipebuf
endif
unlet! s:wipebuf
set winheight=1 winwidth=20
let &shortmess = s:shortmess_save
let s:sx = expand("<sfile>:p:r")."x.vim"
if filereadable(s:sx)
exe "source " . fnameescape(s:sx)
endif
let &g:so = s:so_save | let &g:siso = s:siso_save
set hlsearch
nohlsearch
doautoall SessionLoadPost
unlet SessionLoad
" vim: set ft=vim :
I have minimal knowledge of what a session file should look like unfortunately.
I wonder if the name is the problem: %home%musinux%projects%front-client@@branchprefix%the-branch-name.vim
Most of mine are named %Users%Oli%.dotfiles@@main.vim
.
The error comes from https://github.com/olimorris/persisted.nvim/blob/ca9900c31ee6e254a0ba7011ba49f48ebf4c8db2/lua/persisted/utils.lua#L57-L58
And indeed, my folder is [...]%front-client[...] so and I see this stackoverflow post so maybe there's a pattern recognition thing going on with it ?
Could you share the full path to the session? Of course change any words for confidentiality reasons.
Yes, here's one:
/home/louis-cherel/.local/share/nvim/sessions/%home%louis-cherel%projects%front@@louis%fix-analytics-export-null-values.vim
I'm also having this same problem:
E5108: Error executing lua: vim/_editor.lua:0: nvim_exec2(): Vim(lua):E5108: Error executing lua ...l/share/nvim/lazy/persisted.nvim/lua/persisted/utils.lua:58: missing '[' after '%f' in pattern
stack traceback:
[C]: in function 'gsub'
...l/share/nvim/lazy/persisted.nvim/lua/persisted/utils.lua:58: in function 'make_session_data'
...l/share/nvim/lazy/persisted.nvim/lua/persisted/utils.lua:133: in function 'load_session'
...al/share/nvim/lazy/persisted.nvim/lua/persisted/init.lua:215: in function 'load'
[string ":lua"]:1: in main chunk
[C]: in function 'nvim_exec2'
vim/_editor.lua: in function 'cmd'
...re/nvim/lazy/dashboard-nvim/lua/dashboard/theme/doom.lua:24: in function <...re/nvim/lazy/dashboard-nvim/lua/dashboard/theme/doom.lua:20>
stack traceback:
[C]: in function 'nvim_exec2'
vim/_editor.lua: in function 'cmd'
...re/nvim/lazy/dashboard-nvim/lua/dashboard/theme/doom.lua:24: in function <...re/nvim/lazy/dashboard-nvim/lua/dashboard/theme/doom.lua:20>
This only happen on this specific folder... The session file is /home/gabe/.local/share/nvim/sessions/%home%gabe%[REDACTED]%[REDACTED]%[REDACTED]@@[REDACTED]%fix-[REDACTED].vim
, and the file contents are:
let SessionLoad = 1
let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1
let v:this_session=expand("<sfile>:p")
silent only
silent tabonly
cd [REDACTED]
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
let s:wipebuf = bufnr('%')
endif
let s:shortmess_save = &shortmess
if &shortmess =~ 'A'
set shortmess=aoOA
else
set shortmess=aoO
endif
argglobal
%argdel
tabnext 1
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
silent exe 'bwipe ' . s:wipebuf
endif
unlet! s:wipebuf
set winheight=1 winwidth=20
let &shortmess = s:shortmess_save
let s:sx = expand("<sfile>:p:r")."x.vim"
if filereadable(s:sx)
exe "source " . fnameescape(s:sx)
endif
let &g:so = s:so_save | let &g:siso = s:siso_save
set hlsearch
nohlsearch
doautoall SessionLoadPost
unlet SessionLoad
" vim: set ft=vim :
On my session filename, I also have a %f
on %fix
(branch name is like something/fix-something
), so I assume this is also the cause...
Thanks for flagging.
Any support you both could offer for this would be great. I don't have capacity right now.
Now that we have a good lead, I'll try to dig in the following weeks
I think I've solved it...can you guys try this PR: https://github.com/olimorris/persisted.nvim/pull/123
Thank you! That fixed it for me :)
Small note: I'd prefer not having my name in your test files, so if you can just twist your test string that would mean a lot to me
Of course. Apologies I hadn't even spotted that.
Your
minimal.lua
configError messages
Describe the bug
I expect
:SessionLoad
to function properly and not failHowever the error message doesn't seem to prevent sessions to actually load
Reproduce the bug
nvim --clean -u ./minimal.lua
:SessionSave
:SessionLoad
-> this should trigger the errorFinal notes: This bug has been there for multiple months for me, and I'm always following the latest dev release of nvim. I'm currently on
NVIM v0.10.0-dev-2976+g208852126
Final checks
minimal.lua
config file above and still get the issueSessionSave
to save the session before restarting Neovim and usingSessionLoad