YouCompleteMe/python/ycm
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
tests Auto merge of #2922 - micbou:improve-diagnostic-match, r=bstaletic 2018-02-18 17:15:46 -08:00
__init__.py Fixing python tests broken in rename 2013-05-19 20:06:14 -07:00
base.py Rewrite completion system 2017-06-21 02:32:57 +02:00
buffer.py Improve diagnostic matches display 2018-02-18 21:32:00 +01:00
diagnostic_filter.py Do not install aliases from future 2017-03-18 18:24:48 +01:00
diagnostic_interface.py Improve diagnostic matches display 2018-02-18 21:32:00 +01:00
omni_completer.py Add omnifunc tests 2017-07-07 22:45:05 +02:00
paths.py Drop Python 2.6 and Python 3.3 2018-01-30 18:34:50 +01:00
setup.py Add error messages when ycmd crashed 2016-05-02 23:08:32 +02:00
syntax_parse.py Add function to capture Vim command output 2018-02-18 14:06:09 +01:00
unsafe_thread_pool_executor.py Update flake8 config 2016-03-06 17:39:55 +00:00
vimsupport.py Auto merge of #2922 - micbou:improve-diagnostic-match, r=bstaletic 2018-02-18 17:15:46 -08:00
youcompleteme.py Improve diagnostic matches display 2018-02-18 21:32:00 +01:00