Allow customisation of the signs

Too many plugins use the default priority of 10 so they race/chase.
Allow uses to configure the priorities and make sure that the defaults
are documented.
This commit is contained in:
Ben Jackson 2020-09-01 13:37:45 +01:00
commit c1b544fb3c
12 changed files with 370 additions and 113 deletions

View file

@ -660,13 +660,6 @@ def Call( vimscript_function, *args ):
return vim.eval( call )
def SignDefined( name ):
if Exists( "*sign_getdefined" ):
return int( vim.eval( f"len( sign_getdefined( '{ Escape( name ) }' ) )" ) )
return False
MEMO = {}
@ -780,13 +773,3 @@ def WindowID( window, tab=None ):
if tab is None:
tab = window.tabpage
return int( Call( 'win_getid', window.number, tab.number ) )
def DefineSign( name, text, texthl, col = 'right' ):
if col == 'right':
if int( Call( 'strdisplaywidth', text ) ) < 2:
text = ' ' + text
text = text.replace( ' ', r'\ ' )
vim.command( f'sign define { name } text={ text } texthl={ texthl }' )