google / google/vim-maktaba

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

Open
#237 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Vim Script
Stars
588
Forks
41
PR merge metrics
No merged PRs in 30d

Description

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:

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.