I'm using vim to do my code job and I installed Nerdtree and YCM.
With this merge, YCM has two functions, which allows us to get the error and warning counts.
Here is my .vimrc
:
autocmd VimEnter * NERDTree
autocmd CursorHold,CursorHoldI * update
set statusline+=%#warningmsg#
set statusline+=%{youcompleteme#GetErrorCount()}
set statusline+=%*
However, when I execute vim
, I will get some errors as below:
Error detected while processing function 191[2]..192[20]..195[8]..159[25]..157[23]..nerdtree#echo[1]..youcompleteme#GetEr
rorCount:
line 1:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function 191[2]..192[20]..195[8]..159[25]..157[23]..nerdtree#echo[1]..youcompleteme#GetEr
rorCount:
line 1:
File "<string>", line 1, in <module>
Press ENTER or type command to continue
Error detected while processing function 191[2]..192[20]..195[8]..159[25]..157[23]..nerdtree#echo[1]..youcompleteme#GetEr
rorCount:
line 1:
NameError: name 'ycm_state' is not defined
Press ENTER or type command to continue
Error detected while processing function 191[2]..192[20]..195[8]..159[25]..157[23]..nerdtree#echo[1]..youcompleteme#GetEr
rorCount:
line 1:
E858: Eval did not return a valid python object
Then, I type enter
, everything works fine, I can see the error counts at the status line.
I don't quite know why but it seems that when I execute vim
, it first loads the plugin Nerdtree, and the function youcompleteme#GetErrorCount()
cause some error. After typing enter
, it loads some files into buffer, then youcompleteme#GetErrorCount()
can work well.
Can we solve this issue?