liuchengxu / eleline.vim

:herb: Another elegant statusline for vim
MIT License
311 stars 79 forks source link

保存文件退出 (:wq) 报错 #21

Closed sunnirvana closed 5 years ago

sunnirvana commented 5 years ago

你好,

在编辑文件,保存退出时,会报如下错误,但是文件保存没问题。 Error detected while processing function 30_on_exit: line 3: E716: Key not present in Dictionary: stdout, 'v:val =~ ""')) E116: Invalid arguments for function filter E116: Invalid arguments for function join E15: Invalid expression: join(filter(self.stdout, 'v:val =~ ""'))%

搜索后,发现应该是如下代码报错: function! s:on_exit(job_id, data, _event) dict abort if !has_key(s:jobs, a:job_id) | return | endif if v:dying | return | endif let l:cur_branch = join(filter(self.stdout, 'v:val =~ ""')) if !empty(l:cur_branch) let l:branch = substitute(l:cur_branch, '', s:font ? " \ue0a0" : ' Git:', '') call s:SetGitBranch(self.cwd, l:branch.' ') else let err = join(self.stderr) if !empty(err) | echoerr err | endif endif call remove(s:jobs, a:job_id) endfunction

对 vim script 不了解,有空可以帮忙看下吗?谢谢

liuchengxu commented 5 years ago

升级 neovim, 版本太低.

sunnirvana commented 5 years ago

升级Neovim后,问题还是存在,可以帮忙看下吗?谢谢

Neovim 版本是 0.5.0 image

在 eleline.vim/plugin/eleline.vim 加了打印信息 image

打印信息中,self 是有 stdout 的,但报错还是 Key not present in Dictionary: stdout image

liuchengxu commented 5 years ago

如果你能够提供可以复现的途径,我可以看下,我这里目前无法复现。