Closed uga-rosa closed 3 years ago
I have tested your minimal vimrc and it works for me.
It seems dein#load_cache_raw()
error.
Please debug it like this.
diff --git a/autoload/dein.vim b/autoload/dein.vim
index 3ee4253..9566c1a 100644
--- a/autoload/dein.vim
+++ b/autoload/dein.vim
@@ -66,11 +66,17 @@ function! dein#load_cache_raw(vimrcs) abort
let cache = get(g:, 'dein#cache_directory', g:dein#_base_path)
\ .'/cache_' . g:dein#_progname
let time = getftime(cache)
+ echomsg time
+ echomsg filter(map(copy(g:dein#_vimrcs),
+ \ { _, val -> getftime(expand(val)) })
if !empty(filter(map(copy(g:dein#_vimrcs),
\ { _, val -> getftime(expand(val)) }), { _, val -> time < val }))
return [{}, {}]
endif
let list = readfile(cache)
+ echomsg len(list)
+ echomsg string(g:dein#_vimrcs)
+ echomsg list[0]
if len(list) != 3 || string(g:dein#_vimrcs) !=# list[0]
return [{}, {}]
endif
diff --git a/autoload/dein.vim b/autoload/dein.vim
index 3ee4253..64e554d 100644
--- a/autoload/dein.vim
+++ b/autoload/dein.vim
@@ -66,11 +66,17 @@ function! dein#load_cache_raw(vimrcs) abort
let cache = get(g:, 'dein#cache_directory', g:dein#_base_path)
\ .'/cache_' . g:dein#_progname
let time = getftime(cache)
+ echomsg time
+ echomsg filter(map(copy(g:dein#_vimrcs),
+ \ { _, val -> getftime(expand(val)) }), { _, val -> time < val })
if !empty(filter(map(copy(g:dein#_vimrcs),
\ { _, val -> getftime(expand(val)) }), { _, val -> time < val }))
return [{}, {}]
endif
let list = readfile(cache)
+ echomsg len(list)
+ echomsg string(g:dein#_vimrcs)
+ echomsg list[0]
if len(list) != 3 || string(g:dein#_vimrcs) !=# list[0]
return [{}, {}]
endif
call dein#load_cache_raw(g:dein#_vimrcs)
1628692991
[]
3
['/home/<username>/dotfiles/nvim/init.vim', '/home/<username>/.config/nvim/dein.toml', '/home/<username>/.config/nvim/dein_lazy.toml']
['/home/<username>/dotfiles/nvim/init.vim', '/home/<username>/.config/nvim/dein.toml', '/home/<username>/.config/nvim/dein_lazy.toml']
@@ -89,8 +95,10 @@ function! dein#load_state(path, ...) abort
\ . '/state_' . g:dein#_progname . '.vim'
if !filereadable(state) | return 1 | endif
try
+ echomsg fnameescape(state)
execute 'source' fnameescape(state)
catch
+ echomsg string(v:exception)
if v:exception !=# 'Cache loading error'
call dein#util#_error('Loading state error: ' . v:exception)
endif
neovim starting message
/home/<username>/.cache/dein/state_nvim.vim
'Cache loading error'
call dein#load_cache_raw(g:dein#_vimrcs)
Why you have called dein#load_cache_raw()
manually?
I think it is not called in startup.
So please read below code.
let lines = [
\ 'if g:dein#_cache_version !=# ' . g:dein#_cache_version . ' || ' .
\ 'g:dein#_init_runtimepath !=# ' . string(g:dein#_init_runtimepath) .
\ ' | throw ''Cache loading error'' | endif',
\ 'let [plugins, ftplugin] = dein#load_cache_raw('.
\ string(g:dein#_vimrcs) .')',
\ "if empty(plugins) | throw 'Cache loading error' | endif",
\ 'let g:dein#_plugins = plugins',
\ 'let g:dein#_ftplugin = ftplugin',
\ 'let g:dein#_base_path = ' . string(g:dein#_base_path),
\ 'let g:dein#_runtime_path = ' . string(g:dein#_runtime_path),
\ 'let g:dein#_cache_path = ' . string(g:dein#_cache_path),
\ 'let &runtimepath = ' . string(&runtimepath),
\ ]
Please compare both g:dein#_cache_version
and g:dein#_init_runtimepath
with your state file values.
If it is not same, it will be returned before dein#load_cache_raw()
call.
I think g:dein#_init_runtimepath
is not same.
Why it is not same? I don't know... It should same if you use the minimal vimrc.
call dein#load_cache_raw(g:dein#_vimrcs)
echo dein#load_cache_raw(g:dein#_vimrcs)
is better.
Please check the return value is not empty lists.
Have you change &runtimepath
after dein#load_state()
?
g:dein#_cache_version
and g:dein#_init_runtimepath
are same with state file values.
echo dein#load_cache_raw(g:dein#_vimrcs)
returned the value is NOT empty list.
The only change I made to the runtimepath that I set up myself is the addition of dein before dein#load_state()
.
P.S. dein#load_cache_raw()
is not called in startup.
OK. So please debug your state file.
It checks g:dein#_cache_version
and g:dein#_init_runtimepath
.
P.S. dein#load_cache_raw() is not called in startup.
The reason is found. It fails the version check or the runtimepath check. The script is under your cache directory. You can debug it.
g:dein#_cache_version and g:dein#_init_runtimepath are same with state file values.
It is really same when the script is executed?
If so why the check is failed? dein#load_cache_raw()
is not called.
I can remove the check easily. But it is not the true fix for it.
I don't know the cause, it's not reproducible, and there are other options for the plugin manager. I can't motivate myself any more. I'm sorry.
Oh
Problems summary
Can't load toml cache. In my case, even if I cut it down to this level, it still echoes failed on starting.
Expected
I have no idea.
Environment Information (Required!)
dein.vim version(SHA1): 4e983ca
OS: Ubuntu on WSL
Vim/neovim version: 0.5.0 stable
Provide a minimal .vimrc with less than 50 lines (Required!)
The reproduce ways from Vim starting (Required!)
Screen shot (if possible)