在编辑文件,保存退出时,会报如下错误,但是文件保存没问题。
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
你好,
在编辑文件,保存退出时,会报如下错误,但是文件保存没问题。 Error detected while processing function30_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 不了解,有空可以帮忙看下吗?谢谢