Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maktaba#plugin#Enter chokes with cryptic E896 error if it finds a flag called "plugin" #237

Open
dbarnett opened this issue Oct 21, 2020 · 1 comment

Comments

@dbarnett
Copy link
Contributor

If you configure a plugin with a typo like Glaive someplugin plugin, you end up with very ugly errors from maktaba when it encounters a flag plugin=1 instead of the dictionary it expects. The error message doesn't help at all to figure out what's wrong and how to change the Glaive line to fix it (by removing the stray plugin or changing it to a valid flag like plugin[mappings]).

Sample cryptic error output that should be improved:

Error detected while processing function maktaba#plugin#Enter:
line   25:
E896: Argument of get() must be a List, Dictionary or Blob
Error detected while processing ~/.vim/plugged/vim-codefmt/plugin/autocmds.vim:
line   20:
E714: List required
line   21:
E121: Undefined variable: s:enter
Error detected while processing function maktaba#plugin#Enter:
line   25:
E896: Argument of get() must be a List, Dictionary or Blob
Error detected while processing ~/.vim/plugged/vim-codefmt/plugin/commands.vim:
line   15:
E714: List required
line   16:
E121: Undefined variable: s:enter
Error detected while processing function maktaba#plugin#Enter:
line   25:
E896: Argument of get() must be a List, Dictionary or Blob
Error detected while processing ~/.vim/plugged/vim-codefmt/plugin/mappings.vim:
line   33:
E714: List required
line   34:
E121: Undefined variable: s:enter
line   39:
E121: Undefined variable: s:plugin
line   44:
E121: Undefined variable: s:prefix
line   50:
E121: Undefined variable: s:prefix
line   56:
E121: Undefined variable: s:prefix
line   61:
E121: Undefined variable: s:prefix
Error detected while processing function maktaba#plugin#Enter:
line   25:
E896: Argument of get() must be a List, Dictionary or Blob
Error detected while processing ~/.vim/plugged/vim-codefmt/plugin/register.vim:
line   15:
E714: List required
line   16:
E121: Undefined variable: s:enter
line   21:
E121: Undefined variable: s:plugin
line   22:
E121: Undefined variable: s:registry
line   26:
E121: Undefined variable: s:registry
line   27:
…
@dbarnett
Copy link
Contributor Author

A better error would say something like Invalid flag "plugin" for plugin "someplugin": Expected a dictionary. Got a number..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant