artur-shaik / vim-javacomplete2

DEPRECATED in favor of jc.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error message when execute "JCimportSort" command

carlsonsantana opened this issue · comments

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!)

  • OS: Linux
  • Vim version: 8.2

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.

May be you can make PR?