Closed klaxalk closed 7 years ago
Thanks for the report. This is related to the issue found by @davits in PR https://github.com/Valloric/YouCompleteMe/pull/2677:
Found and fixed bug when YouCompleteMe._current_buffer were not updating correctly/in time. It was happening because FileType event in Vim comes before BufEnter, and reparse from BufEnter is blocked by s:VisitedBufferRequiresReparse(). So it will end up sending file parse event for the previous buffer from FileType and updating current buffer to current one on BufVisit, but not sending parse event for it.
In that particular case, YCM calls getbufvar
on a deleted buffer (the one created by Startify). When the buffer doesn't exist, this function returns an empty string that YCM tries to convert to an integer and the error ensues. This should be fixed by PR #2677 but I think we also need to remove deleted buffers from YCM own buffers list on the BufferUnload
event or this list will grow indefinitely. I don't know if Vim reuse buffer numbers from deleted buffers but this could be an issue too.
Fixed by PR #2677.
Issue Prelude
vim --version
.:YcmDebugInfo
.:YcmToggleLogs
command.install.py
(orcmake
/make
/ninja
) including its invocationIssue Details
Hello, since the commit 8c6efb42148e2e84f33b3510e6d0539dcf11b6a1 on July 4th, YCM outputs following error when openning a file (e.g. ~/.bashrc) using Startify homescreen history (or bookmarks) (https://github.com/mhinz/vim-startify):
Vim 8.0.0628 compiled from sources (commit f085f4266e07b36279c56d43fd0d73ed080046ae) as
Minimal .vimrc (using vim-plug) to reproduce the error:
YCM is installed as
Diagnostic data
Output of
vim --version
https://gist.github.com/klaxalk/1c3ca79d5cb14095689529655ff1b20b
Output of
YcmDebugInfo
Printing YouCompleteMe debug information... -- Client logfile: /tmp/ycm_KHGxcf.log -- Server Python interpreter: /usr/bin/python -- Server Python version: 2.7.12 -- Server has Clang support compiled in: True -- Clang version: clang version 4.0.0 (tags/RELEASE_400/final) -- Extra configuration file found and loaded -- Extra configuration path: /home/klaxalk/.ycm_extra_conf.py -- Server running at: http://127.0.0.1:38676 -- Server process ID: 17068 -- Server logfiles: -- /tmp/ycmd_38676_stdout_HyZHGf.log -- /tmp/ycmd_38676_stderr_MuZoUn.log
Contents of YCM, ycmd and completion engine logfiles
ycmd_stdout log serving on http://127.0.0.1:38676
ycmd_stderr log https://gist.github.com/klaxalk/b4e6740c6154a4d792f2c473dd90d913
OS version, distribution, etc.
Ubuntu 16.04 64bit