Ensure signs are only padded when 1 display cell
This commit is contained in:
parent
3c1ac36e6e
commit
dae5760900
3 changed files with 22 additions and 4 deletions
|
|
@ -53,13 +53,19 @@ class ProjectBreakpoints( object ):
|
|||
self._next_sign_id = 1
|
||||
|
||||
if not utils.SignDefined( 'vimspectorBP' ):
|
||||
vim.command( 'sign define vimspectorBP text=\\ ● texthl=WarningMsg' )
|
||||
utils.DefineSign( 'vimspectorBP',
|
||||
text = '●',
|
||||
texthl = 'WarningMsg' )
|
||||
|
||||
if not utils.SignDefined( 'vimspectorBPCond' ):
|
||||
vim.command( 'sign define vimspectorBPCond text=\\ ◆ texthl=WarningMsg' )
|
||||
utils.DefineSign( 'vimspectorBPCond',
|
||||
text = '◆',
|
||||
texthl = 'WarningMsg' )
|
||||
|
||||
if not utils.SignDefined( 'vimspectorBPDisabled' ):
|
||||
vim.command( 'sign define vimspectorBPDisabled text=\\ ● texthl=LineNr' )
|
||||
utils.DefineSign( 'vimspectorBPDisabled',
|
||||
text = '●',
|
||||
texthl = 'LineNr' )
|
||||
|
||||
|
||||
def ConnectionUp( self, connection ):
|
||||
|
|
|
|||
|
|
@ -51,7 +51,9 @@ class CodeView( object ):
|
|||
vim.command( 'nnoremenu WinBar.✕ :call vimspector#Reset()<CR>' )
|
||||
|
||||
if not utils.SignDefined( 'vimspectorPC' ):
|
||||
vim.command( 'sign define vimspectorPC text=\\ ▶ texthl=MatchParen' )
|
||||
utils.DefineSign( 'vimspectorPC',
|
||||
text = '▶',
|
||||
texthl = 'MatchParen' )
|
||||
|
||||
|
||||
def SetCurrentFrame( self, frame ):
|
||||
|
|
|
|||
|
|
@ -777,3 +777,13 @@ 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