vim-patch:9.0.1671: Termdebug: error with more than 99 breakpoints (#24194)

Problem:    Termdebug: error with more than 99 breakpoints.
Solution:   Use a different sign for breakpoint 100 and over. (closes vim/vim#12589,
            closes vim/vim#12588)

e7d9ca2b3b

Co-authored-by: skywind3000 <skywind3000@163.com>
This commit is contained in:
zeertzjq
2023-06-29 07:04:46 +08:00
committed by GitHub
parent a878e02d5d
commit 421c66f741
2 changed files with 25 additions and 1 deletions

View File

@@ -1543,8 +1543,18 @@ func s:CreateBreakpoint(id, subid, enabled)
let hiName = "debugBreakpointDisabled"
else
let hiName = "debugBreakpoint"
endif
let label = ''
if exists('g:termdebug_config')
let label = get(g:termdebug_config, 'sign', '')
endif
if label == ''
let label = substitute(nr, '\..*', '', '')
if strlen(label) > 2
let label = strpart(label, strlen(label) - 2)
endif
endif
call sign_define('debugBreakpoint' .. nr,
call sign_define('debugBreakpoint' .. nr,
\ #{text: strpart(label, 0, 2),
\ texthl: hiName})
endif