YouCompleteMe/python/ycm/tests
zzbot 54a4ecf2d9
Auto merge of #2922 - micbou:improve-diagnostic-match, r=bstaletic
[READY] Improve diagnostic matches display

There are two issues with how we display diagnostic matches. The first issue is that if the current buffer contains diagnostic matches and is split in a new window, all the matches are cleared and only matches in the new window are shown. The second issue is that if a new buffer with no diagnostic support is open in the current window and that window already contained matches then the matches are still displayed. Here's an illustration of both issues (signs are disabled):

![diagnostic-matches-issue](https://user-images.githubusercontent.com/10026824/36352338-bfeb2092-14b7-11e8-88f4-ae8cf6903304.gif)

The solution is to add an autocommand that updates matches on the `BufEnter` and `WinEnter` events. Here's the result:

![diagnostic-matches-fix](https://user-images.githubusercontent.com/10026824/36352340-c2a64a8c-14b7-11e8-8db2-4f1f54448c65.gif)

Note that it's not perfect as multiple windows of the same buffer won't be updated simultaneously. Supporting that scenario is rather tricky because we would need to go through all the windows to update the matches and switching windows can lead to a lot of issues (like interrupting visual mode) so we don't.

This PR also improves how we update matches by only displaying matches that are not already present and then clearing the remaining ones (similarly to what we do with signs; see PR https://github.com/Valloric/YouCompleteMe/pull/2915) instead of always clearing all the matches then displaying the new ones.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2922)
<!-- Reviewable:end -->
2018-02-18 17:15:46 -08:00
..
client Add range support to completer command 2018-02-12 01:50:08 +01:00
testdata Tests for checking that extra_conf_data sended to server from :DebugInfo and :YcmCompleter commands. 2017-03-12 19:03:07 +03:00
__init__.py Echo diagnostic asynchronously 2017-10-04 16:59:47 +02:00
base_test.py Use codepoint offsets in identifier functions 2017-06-18 20:41:30 +02:00
command_test.py Add range support to completer command 2018-02-12 01:50:08 +01:00
completion_test.py Rewrite completion system 2017-06-21 02:32:57 +02:00
diagnostic_filter_test.py Do not install aliases from future 2017-03-18 18:24:48 +01:00
event_notification_test.py Add function to capture Vim command output 2018-02-18 14:06:09 +01:00
mock_utils.py Add support for Java diagnostics and asynchronous messages 2018-02-10 16:29:27 +00:00
omni_completer_test.py Use fake filetype for omni completion test 2017-12-23 15:41:14 +00:00
paths_test.py Drop Python 2.6 and Python 3.3 2018-01-30 18:34:50 +01:00
postcomplete_test.py Support for additional FixIts on java completions 2018-02-11 18:11:34 +00:00
syntax_parse_test.py Do not install aliases from future 2017-03-18 18:24:48 +01:00
test_utils.py Auto merge of #2922 - micbou:improve-diagnostic-match, r=bstaletic 2018-02-18 17:15:46 -08:00
vimsupport_test.py Improve diagnostic matches display 2018-02-18 21:32:00 +01:00
youcompleteme_test.py Improve diagnostic matches display 2018-02-18 21:32:00 +01:00