Skip to content

Commit

Permalink
Merge pull request #4166 from Aster89/master
Browse files Browse the repository at this point in the history
Address #4165: provide a highlight group for the detailed diagnostic popup
  • Loading branch information
mergify[bot] authored Sep 12, 2023
2 parents c400db0 + f742ecb commit abea6de
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions autoload/youcompleteme.vim
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ function! s:SetUpSyntaxHighlighting()
\ 'combine': 0,
\ 'override': 1 } )
endif

if !hlexists( 'YcmErrorPopup' )
highlight default link YcmErrorPopup ErrorMsg
endif
endfunction


Expand Down
4 changes: 4 additions & 0 deletions doc/youcompleteme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/ycm/youcompleteme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit abea6de

Please sign in to comment.