artur-shaik / vim-javacomplete2

DEPRECATED in favor of jc.nvim
Vim License
973 stars 83 forks source link

Error message when execute "JCimportSort" command #453

Closed carlsonsantana closed 3 years ago

carlsonsantana commented 3 years ago

Actual behavior (Required!)

Vim show an error message when execute "JCimportSort" command first time, but execute the command. This error only occurs in one project, others work without errors.

Expected behavior (Required!)

Not show the error message in any project.

The steps to reproduce actual behavior (Required!)

  1. Open a Java file;
  2. Go to command mode;
  3. Execute command JCimportSort

Environment (Required!)

The output of :redir and :message (Optional)

Error detected while processing /home/carlson/.vim/plugins/vim-javacomplete2/autoload/javacomplete/imports.vim[316]..function javacomplete#util#GetRegularClassesDict: line 10: E684: list index out of range: -1 E116: Invalid arguments for function extend

My own fix

To fix this error I edited the file autoload/javacomplete/util.vim and surround by if clause with class != '' condition.

artur-shaik commented 3 years ago

May be you can make PR?