Skip to content

Commit

Permalink
Merge pull request #4157 from puremourning/sig-help-disable-syntax
Browse files Browse the repository at this point in the history
Add option to disable signature help syntax highlights
  • Loading branch information
mergify[bot] committed Aug 18, 2023
2 parents f09c2f6 + 7d3e6db commit a2e6736
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
16 changes: 15 additions & 1 deletion README.md
Expand Up @@ -889,7 +889,8 @@ Signature help is triggered in insert mode automatically when
`g:ycm_auto_trigger` is enabled and is not supported when it is not enabled.

The signatures popup is hidden when there are no matching signatures or when you
leave insert mode. There is no key binding to clear the popup.
leave insert mode. If you want to manually control when it is visible, you can
map something to `<plug>YCMToggleSignatureHelp` (see below).

For more details on this feature and a few demos, check out the
[PR that proposed it][signature-help-pr].
Expand Down Expand Up @@ -3715,6 +3716,19 @@ Default: `0`
let g:ycm_disable_signature_help = 1
```
### The `g:ycm_signature_help_disable_syntax` option
Set this to 1 to disable syntax highlighting in the signature help popup. Thiis
can help if your colourscheme doesn't work well with the default highliting and
inverse video.
Default: `0`
```viml
" Disable signature help syntax highliting
let g:ycm_signature_help_disable_syntax = 1
```
### The `g:ycm_gopls_binary_path` option
In case the system-wide `gopls` binary is newer than the bundled one, setting
Expand Down
6 changes: 5 additions & 1 deletion python/ycm/signature_help.py
Expand Up @@ -189,7 +189,11 @@ def UpdateSignatureHelp( state, signature_info ): # noqa
if state.state == SignatureHelpState.ACTIVE:
vim.eval( f'popup_show( { state.popup_win_id } )' )

syntax = utils.ToUnicode( vim.current.buffer.options[ 'syntax' ] )
if vim.vars.get( 'ycm_signature_help_disable_syntax', False ):
syntax = ''
else:
syntax = utils.ToUnicode( vim.current.buffer.options[ 'syntax' ] )

active_signature = int( signature_info.get( 'activeSignature', 0 ) )
vim.eval( f"win_execute( { state.popup_win_id }, "
f"'set syntax={ syntax } cursorline | "
Expand Down

0 comments on commit a2e6736

Please sign in to comment.