Fix ambiwidth=double again and make sure it doesn't break again

This commit is contained in:
Ben Jackson 2020-09-25 16:28:54 +01:00
commit b34ccd679d
4 changed files with 735 additions and 1 deletions

View file

@ -55,16 +55,19 @@ class ProjectBreakpoints( object ):
if not signs.SignDefined( 'vimspectorBP' ):
signs.DefineSign( 'vimspectorBP',
text = '',
double_text = '',
texthl = 'WarningMsg' )
if not signs.SignDefined( 'vimspectorBPCond' ):
signs.DefineSign( 'vimspectorBPCond',
text = '',
double_text = '',
texthl = 'WarningMsg' )
if not signs.SignDefined( 'vimspectorBPDisabled' ):
signs.DefineSign( 'vimspectorBPDisabled',
text = '',
double_text = '',
texthl = 'LineNr' )

View file

@ -53,11 +53,13 @@ class CodeView( object ):
if not signs.SignDefined( 'vimspectorPC' ):
signs.DefineSign( 'vimspectorPC',
text = '',
double_text = '',
texthl = 'MatchParen',
linehl = 'CursorLine' )
if not signs.SignDefined( 'vimspectorPCBP' ):
signs.DefineSign( 'vimspectorPCBP',
text = '●▶',
double_text = '',
texthl = 'MatchParen',
linehl = 'CursorLine' )

View file

@ -12,7 +12,10 @@ def SignDefined( name ):
return False
def DefineSign( name, text, texthl, col = 'right', **kwargs ):
def DefineSign( name, text, double_text, texthl, col = 'right', **kwargs ):
if utils.GetVimValue( vim.options, 'ambiwidth', '' ) == 'double':
text = double_text
if col == 'right':
if int( utils.Call( 'strdisplaywidth', text ) ) < 2:
text = ' ' + text