Skip to content

Commit a2e6736

Browse files
authored
Merge pull request #4157 from puremourning/sig-help-disable-syntax
Add option to disable signature help syntax highlights
2 parents f09c2f6 + 7d3e6db commit a2e6736

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,8 @@ Signature help is triggered in insert mode automatically when
889889
`g:ycm_auto_trigger` is enabled and is not supported when it is not enabled.
890890

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

894895
For more details on this feature and a few demos, check out the
895896
[PR that proposed it][signature-help-pr].
@@ -3715,6 +3716,19 @@ Default: `0`
37153716
let g:ycm_disable_signature_help = 1
37163717
```
37173718
3719+
### The `g:ycm_signature_help_disable_syntax` option
3720+
3721+
Set this to 1 to disable syntax highlighting in the signature help popup. Thiis
3722+
can help if your colourscheme doesn't work well with the default highliting and
3723+
inverse video.
3724+
3725+
Default: `0`
3726+
3727+
```viml
3728+
" Disable signature help syntax highliting
3729+
let g:ycm_signature_help_disable_syntax = 1
3730+
```
3731+
37183732
### The `g:ycm_gopls_binary_path` option
37193733
37203734
In case the system-wide `gopls` binary is newer than the bundled one, setting

python/ycm/signature_help.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ def UpdateSignatureHelp( state, signature_info ): # noqa
189189
if state.state == SignatureHelpState.ACTIVE:
190190
vim.eval( f'popup_show( { state.popup_win_id } )' )
191191

192-
syntax = utils.ToUnicode( vim.current.buffer.options[ 'syntax' ] )
192+
if vim.vars.get( 'ycm_signature_help_disable_syntax', False ):
193+
syntax = ''
194+
else:
195+
syntax = utils.ToUnicode( vim.current.buffer.options[ 'syntax' ] )
196+
193197
active_signature = int( signature_info.get( 'activeSignature', 0 ) )
194198
vim.eval( f"win_execute( { state.popup_win_id }, "
195199
f"'set syntax={ syntax } cursorline | "

0 commit comments

Comments
 (0)