Skip to content

Commit 7d3e6db

Browse files
committed
Add option to disable signature help syntax highlights
1 parent f93c2e9 commit 7d3e6db

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].
@@ -3689,6 +3690,19 @@ Default: `0`
36893690
let g:ycm_disable_signature_help = 1
36903691
```
36913692
3693+
### The `g:ycm_signature_help_disable_syntax` option
3694+
3695+
Set this to 1 to disable syntax highlighting in the signature help popup. Thiis
3696+
can help if your colourscheme doesn't work well with the default highliting and
3697+
inverse video.
3698+
3699+
Default: `0`
3700+
3701+
```viml
3702+
" Disable signature help syntax highliting
3703+
let g:ycm_signature_help_disable_syntax = 1
3704+
```
3705+
36923706
### The `g:ycm_gopls_binary_path` option
36933707
36943708
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)