Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address #4165: provide a highlight group for the detailed diagnostic popup #4166

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading