neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.43k stars 954 forks source link

E16: Invalid range: call s:Autocmd('Dirchanged', get(v:event,'cmd', '')) #1047

Closed avriltank closed 5 years ago

avriltank commented 5 years ago

Suppose I have two buffers now, /home/chenfa/one.vim and /home/chenfa/two.vim. Now I execute the command in the /home/chenfa/one.vim buffer: cd /home, then execute :bnext, this time vim will report E16: Invalid range: call s:Autocmd('Dirchanged', get(v:event,'cmd', '')), I roughly looked at /coc.nvim/plugin/ The line 170 in coc.vim seems to have an automatic command. Is there a bug here, or is it wrong with me? Thanks!

avriltank commented 5 years ago

the autocommand called by this function coc#rpc#notify('CocAutocmd', a:000) =》s:client['notify'](a:method, a:args)=》s:notify(method, args)。I can not find is there anything wrong。otherwise,if i do not set autochdir in my init.vim,there is no error !

chemzqm commented 5 years ago

No idea what happened, it doesn't happens for me on vim8 and neovim. Need minimal vimrc and vim version.

chemzqm commented 5 years ago

From vim's doc Note: When this option is on some plugins may not work.

MustaphaRashiduddin commented 5 years ago

I also get same error when using neovim-fuzzy

Error detected while processing DirChanged Autocommands for "*":
E16: Invalid range: call s:Autocmd('DirChanged', get(v:event, 'cwd', ''))

if i do not set autochdir in my init.vim,there is no error.

chemzqm commented 5 years ago

Vim or neovim should fix this error, my suggest is avoid autochdir option.