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:
parent
e634982d78
commit
c1b544fb3c
12 changed files with 370 additions and 113 deletions
|
|
@ -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 }' )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue