Skip to content

Commit

Permalink
Address #4165: provide a highlight group for the detailed diagnostic …
Browse files Browse the repository at this point in the history
…popup

This seems to work, but I have a few questions

  - What tests should I look at to understand how to write one for this
    change?
  - Are you happy with the name `YcmErrorPopup`?
  - What should I set as `'priority'`, `'combine'`, `'override'`?
  • Loading branch information
Aster89 committed Aug 18, 2023
1 parent 18fa0f4 commit b2b9c9a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions autoload/youcompleteme.vim
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,17 @@ function! s:SetUpSyntaxHighlighting()
\ 'combine': 0,
\ 'override': 1 } )
endif

if !hlexists( 'YcmErrorPopup' )
highlight default link YcmErrorPopup ErrorMsg
endif
if s:PropertyTypeNotDefined( 'YcmErrorProperty' )
call prop_type_add( 'YcmErrorProperty', {
\ 'highlight': 'YcmErrorPopup',
\ 'priority': 30,
\ 'combine': 0,
\ 'override': 1 } )

Check warning on line 524 in autoload/youcompleteme.vim

View check run for this annotation

Codecov / codecov/patch

autoload/youcompleteme.vim#L520-L524

Added lines #L520 - L524 were not covered by tests
endif
endfunction


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 b2b9c9a

Please sign in to comment.