This gets rid of the annoying flashing (issue #669), but reverts the workaround
for a rare Vim crash bug (issue #593). We can't have both. Update to latest Vim
to not get the crash bug.
Fixes#669.
This can happen when the user inserts a candidate string like "operator[]" which
doesn't end with an identifier char. A very obscure bug, but a bug nonetheless.
This is needed so that Syntastic doesn't call :SyntasticCheck (and thus YCM
code) on file save unnecessarily. We call :SyntasticCheck ourselves often
enough.
Previously the YCM Vim client would go bonkers when ycmd crashed. Now the user
can continue using Vim just without YCM functionality.
Also added a :YcmRestartServer command to let the user restart ycmd if it
crashed. With a little luck, this will be rarely necessary.
This means we can now load just ycm_client_support (which is a much smaller
library) into Vim and ycm_core into ycmd. Since ycm_client_support never depends
on libclang.so, we never have to load that into Vim which makes things much,
much easier.
This happened when moving the cursor in normal mode. The problem was that we
were calling SyntasticCheck on every cursor move because YCM would think that
the FileReadyToParse event processing returned diagnostics... but YCM only
integrates with Syntastic for C-family files.
Fixed by only triggering SyntasticCheck in C-family files.
Now, every FileReadyToParse event returns diagnostics, if any. This is instead
of the previous system where the diagnostics were being fetched in a different
request (this caused race conditions).
There appear to be timing issues for the diag requests. Somehow, we're sending
out-of-date diagnostics and then not updating the UI when things change.
That needs to be fixed.
This is still fast & efficient because if we detect that the buffer hasn't been
changed (by examining b:changedtick), the parse doesn't proceed.
In effect, we now make sure we parse the file after every change to the buffer
as soon as that change happens. This means that compilation error feedback will
now be much, MUCH quicker.
We used to do it on buffer enter and cursor hold. Doing it on insert leave too
produces much quicker compilation error feedback when editing C-family code
because the user doesn't have to wait for the next cursor hold event.
For now, doing it just for detecting whether a change was made on move in insert
mode.
Using b:changedtick instead of our homebrew way of detecting the changed should
be both faster and more robust.
If the user forced YCM to not register itself as the Syntastic checker, we
should not be calling SyntasticCheck since that would slow down everything.
Fixes#416
For instance (`|` represents the cursor):
1. Buffer state: `foo.|bar`
2. A completion candidate of `zoobar` is shown and the user selects it.
3. Buffer state: `foo.zoobar|bar` instead of `foo.zoo|bar` which is what the
user wanted.
This commit resolves that issue.
It could be argued that the user actually wants the final buffer state to be
`foo.zoobar|` (the cursor at the end), but that would be much more difficult
to implement and is probably not worth doing.
Fixes#374.