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

List index out of range error when checking types #28

Open
tysonzero opened this issue Feb 26, 2017 · 0 comments
Open

List index out of range error when checking types #28

tysonzero opened this issue Feb 26, 2017 · 0 comments

Comments

@tysonzero
Copy link
Contributor

tysonzero commented Feb 26, 2017

Whenever hdevtools emits a warning message, which isn't all that infrequent, something like an unused import or a defined and not used variable will cause it to emit warnings. :HdevtoolsType will give a bunch of errors that make it a huge pain to use.

The code causing the issue is here:

let l:types = []
for l:line in split(l:output, '\n')
  let l:m = matchlist(l:line, '\(\d\+\) \(\d\+\) \(\d\+\) \(\d\+\) "\([^"]\+\)"')
  call add(l:types, [l:m[1 : 4], l:m[5]])
endfor

Since the regex does not correctly parse the warning message. Index 5 is out of range. Causing the following error messages to appear:

Error detected while processing function hdevtools#type:
line   30:
E684: list index out of range: 5
E116: Invalid arguments for function add
... (above two lines repeated often several times, taking up often a good third of the screen)

I personally think the onus is on vim-hdevtools to silently ignore those warnings. Since I will see them on save from hdevtools itself anyway, so I don't need them annoying me whenever I want to check types of things.

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

No branches or pull requests

1 participant