diff --git a/README.md b/README.md index b4bd2b11de..9d60804fd8 100644 --- a/README.md +++ b/README.md @@ -1770,6 +1770,10 @@ You can also style the line that has the warning/error with these groups: - `YcmWarningLine`, which falls back to group `SyntasticWarningLine` if it exists +Finally, you can also style the popup for the detailed diagnostics (it is shown +if `g:ycm_show_detailed_diag_in_popup` is set) using the group `YcmErrorPopup`, +which falls back to `ErrorMsg`. + Note that the line highlighting groups only work when the [`g:ycm_enable_diagnostic_signs`](#the-gycm_enable_diagnostic_signs-option) option is set. If you want highlighted lines but no signs in the Vim gutter, diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index f525316dcb..aacbf6e95c 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -512,6 +512,10 @@ function! s:SetUpSyntaxHighlighting() \ 'combine': 0, \ 'override': 1 } ) endif + + if !hlexists( 'YcmErrorPopup' ) + highlight default link YcmErrorPopup ErrorMsg + endif endfunction diff --git a/doc/youcompleteme.txt b/doc/youcompleteme.txt index decfa99ae4..c16c100e2c 100644 --- a/doc/youcompleteme.txt +++ b/doc/youcompleteme.txt @@ -2017,6 +2017,10 @@ You can also style the line that has the warning/error with these groups: - 'YcmWarningLine', which falls back to group 'SyntasticWarningLine' if it exists +Finally, you can also style the popup for the detailed diagnostics (it is shown +if |g:ycm_show_detailed_diag_in_popup| is set) using the group 'YcmErrorPopup', +which falls back to |ErrorMsg|. + Note that the line highlighting groups only work when the |g:ycm_enable_diagnostic_signs| option is set. If you want highlighted lines but no signs in the Vim gutter, set the 'signcolumn' option to 'no' in your diff --git a/python/ycm/youcompleteme.py b/python/ycm/youcompleteme.py index 5d9ac6cd15..d7eb18862b 100644 --- a/python/ycm/youcompleteme.py +++ b/python/ycm/youcompleteme.py @@ -849,7 +849,7 @@ def ShowDetailedDiagnostic( self, message_in_popup ): 'maxwidth': available_columns, 'close': 'click', 'fixed': 0, - 'highlight': 'ErrorMsg', + 'highlight': 'YcmErrorPopup', 'border': [ 1, 1, 1, 1 ], # Close when moving cursor 'moved': 'expr',