Hi,
As of update 9648145ab155a6b114c354fe790fad484ad02f5a , I'm getting the following error when writing a buffer:
Error detected while processing function
19_BufWritePostHook[4]..
19_UpdateErrors
[15]..19_CacheErrors[29]..20:
line 7:
E713: Cannot use empty key for Dictionary
Reverting to 59cc80a8f7f7544a364814622dc62efd00d17ca4 resolves the issue.
Thanks for a wonderful coding resource!
I can't reproduce the problem with the current master HEAD, and the error message is rather cryptic. It would help if you could tell me what "function 20" is in the above stack trace. Sadly Vim makes that a pain in the rear. One way to do it would be to enable profiling (cf. :h syntastic-profiling), trigger the bug in a minimal scenario, then search the logs for ^FUNCTION 20() and locate the corresponding piece of code in plugin/syntastic.vim. Or just upload the logs somewhere and post the link.
Another way to do it would be to disable all other plugins, run Vim as vim -V12log your_file, trigger the bug, and again, locate function 20, or upload the logs and post the link.
Never mind. Please update to the current master HEAD and try again.
same error when saving upon my own init.vim file:
https://github.com/gzmask/my-neovim/blob/master/init.vim
"init.vim" 60L, 1642C written
Error detected while processing function
line 7:
E713: Cannot use empty key for Dictionary
Press ENTER or type command to continue
@gzmask Are you using the current master HEAD, i.e. 75b1095? Can you reproduce the problem with plain Vim (rather than Neovim)?
@lcd047 I have the same issue. Both with neovim and vim.
Just updated and have the same issue with neovim. Not in vim though I should check.
@nicoe All of you guys omit the most important detail: are you using commit 75b1095?
I use vimplug and when I run :PlugSnapshot, it says:
silent! let g:plugs['syntastic'].commit = '75b1095'
So I guess I'm using that commit.
@nicoe all of you guys omit the most important detail: are you using commit 75b1095?
Of course I am why would I bother commenting otherwise ?
@dkim87 Your faith in your plugin manager is heart-warming, but you really should check with git rev-parse HEAD.
Anyway, that error doesn't make sense for 75b1095, since the key for the dictionary is set a few lines above. I also can't reproduce the problem. So you'll have to give me something more actionable than the error above. _shrug_
Can you people reproduce the problem with Vim (not neovim), and all other plugins disabled? What is your configuration, and what checker is being run?
Yeap, I cd to .vim/plugged/syntastic and checked the commit with git rev-parse HEAD. Here is the result: 75b1095586b1cb685ccb0e69004bcd4ae75b37da
Thanks for the instruction.
Can you people reproduce the problem with Vim (not neovim)
Yes
and all other plugins disabled?
Yes
What is your configuration, and what checker is being run?
vimlint
Here's the minimal .vimrc that results in the error:
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/syntastic'
call plug#end()
let g:syntastic_check_on_open = 1
I just edit this .vimrc file.
Can you people reproduce the problem with Vim (not neovim)
No. For me it only happens with Neovim, and only when attempting to open .vimrc file.
I use the latest Vim 8.0. Probably that is the reason I do not reproduce the same problem with Vim.
and all other plugins disabled?
For Vim, as mentioned above, no. For Neovim, Yes
One interesting point: I only have this error message when I open .vimrc (which I symlinked to dotfiles/init.vim). With the other file extensions such as .c, .txt, .csv it works just fine.
@nicoe I'm afraid I still can't reproduce the problem. What version of Vim are you using?
I realized that I'm having this problem only (with Neovim) when I try to open .vimrc, init.vim, plugins.vimrc, mappings.vimrc, etc. (These are vim-related files that I modularized). I tried other extensions such as .c, .txt, .md, and even created some random extension like .asdf and it didn't reproduce the problem.
@dkim87 Syntastic "should work" with Neovim, but that combination isn't supported. As in, I don't have Neovim, and if you can't reproduce the problem with plain Vim I have no way to help you. Other people may be able to trace the problem though.
@nicoe: When you have no other plugins than syntastic, vimlint shouldn't be enabled. Just saying.
What version of Vim are you using?
Good catch.
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar 31 2015 23:35:24)
Included patches: 1-488, 576
It's an debian server running jessie.
I installed vim on my laptop:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 13 2016 01:54:12)
Included patches: 1-3
The issue is not present on my laptop when using vim. But it appears when using neovim.
As @dkim87, it only happens for vim files. I guess there is a fix in Vim 8.0 that is not in neovim.
When you have no other plugins than syntastic, vimlint shouldn't be enabled. Just saying.
I kinda guess it was vimlint, what else could it be ?
This might be related to a quirk of the vimlint checker. Please try upgrading to 4c4e516.
I got a hint from nicoe and tried vim 7.4 and (probably) succeeded in reproducing the problem. Here is how:
I use MacOS X and brew vim. I 'cd'ed to /usr/local/Cellar/vim/7.4.2290/bin and run
$./vim ~/helloworld.c and it says on the command line as following:
E484: Can't open file /usr/local/share/vim/syntax/syntax.vim
If I 'cd' to /usr/local/Cellar/vim/8.0.0019/bin and do the same then it does not produce any error. I assume it might be a compatibility issue between vim 7.4 and 8.0.
E484: Can't open file /usr/local/share/vim/syntax/syntax.vim
This means your Vim 7.4.2290 can't find a syntax file, for whatever reasons (no plugin manager, renamed runtime, renamed init files, ...). Not exactly syntastic's fault. :smile:
If I 'cd' to /usr/local/Cellar/vim/8.0.0019/bin and do the same then it does not produce any error.
This means your Vim 8.0.19 _can_ find said syntax file. Nice, but not making any progress WRT the problem at hand.
Can you still trigger the problem with 4c4e516, as I said above?
4c4e516 solved the problem at least for me! Now not only vim 8.0 but Neovim also does not generate any problem. Thank you!
This might be related to a quirk of the vimlint checker. Please try upgrading to 4c4e516.
This changeset fixed the problem with my (rather old) vim and with neovim. Thank you.
Ain't that a bit strange that vim8 does not have the issue ?
Ok. Does that fix the problem for everybody else?
@nicoe Yup, it's actually highly relevant where the difference comes from. I'll try to find out.
Ok, I now have the full picture. The difference is Vim 8.0 and late 7.4 can, actually, take empty strings as dictionary keys, while Neovim and earlier Vim 7.4 can't. As it turns out, vimlint was the only checker that triggered that problem, because of a quirk. The problem _was_ present in Vim 8.0 as well as elsewhere, but it didn't trigger an exception, and it didn't impact the later code. I'm confident it's now fixed (by 4c4e516).
Thanks for getting this. I was out this morning and just saw the thread and the fact it was super quickly handled. 4c4e516e1ddd7c1b04624e26be1bbb41bc6b7edb corrects it for me with vim 7.4 on Darwin.
Most helpful comment
Ok, I now have the full picture. The difference is Vim 8.0 and late 7.4 can, actually, take empty strings as dictionary keys, while Neovim and earlier Vim 7.4 can't. As it turns out,
vimlintwas the only checker that triggered that problem, because of a quirk. The problem _was_ present in Vim 8.0 as well as elsewhere, but it didn't trigger an exception, and it didn't impact the later code. I'm confident it's now fixed (by 4c4e516).