Skip to content

Commit e7d9ca2

Browse files
skywind3000brammool
authored andcommitted
patch 9.0.1671: Termdebug: error with more than 99 breakpoints
Problem: Termdebug: error with more than 99 breakpoints. Solution: Use a different sign for breakpoint 100 and over. (closes #12589, closes #12588)
1 parent bf5f189 commit e7d9ca2

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

runtime/doc/terminal.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*terminal.txt* For Vim version 9.0. Last change: 2023 Jun 09
1+
*terminal.txt* For Vim version 9.0. Last change: 2023 Jun 28
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1541,6 +1541,20 @@ If there is no g:termdebug_config you can use: >
15411541
let g:termdebug_popup = 0
15421542
15431543
1544+
Change default signs ~
1545+
*termdebug_signs*
1546+
Termdebug uses the last two characters of the breakpoint ID in the
1547+
signcolumn to represent breakpoints. For example, breakpoint ID 133
1548+
will be displayed as `33`.
1549+
1550+
If you want to customize the breakpoint signs: >
1551+
let g:termdebug_config['sign'] = '>>'
1552+
If there is no g:terminal_config yet you can use: >
1553+
let g:termdebug_config = {'sign': '>>'}
1554+
1555+
After this, breakpoints will be displayed as `>>` in the signcolumn.
1556+
1557+
15441558
Window toolbar ~
15451559
*termdebug_winbar*
15461560
By default the Termdebug plugin creates a window toolbar if the mouse is

runtime/pack/dist/opt/termdebug/plugin/termdebug.vim

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,9 +1401,19 @@ func s:CreateBreakpoint(id, subid, enabled)
14011401
else
14021402
let hiName = "debugBreakpoint"
14031403
endif
1404+
let label = ''
1405+
if exists('g:termdebug_config')
1406+
let label = get(g:termdebug_config, 'sign', '')
1407+
endif
1408+
if label == ''
1409+
let label = substitute(nr, '\..*', '', '')
1410+
if strlen(label) > 2
1411+
let label = strpart(label, strlen(label) - 2)
1412+
endif
1413+
endif
14041414
call sign_define('debugBreakpoint' .. nr,
1405-
\ #{text: substitute(nr, '\..*', '', ''),
1406-
\ texthl: hiName})
1415+
\ #{text: strpart(label, 0, 2),
1416+
\ texthl: hiName})
14071417
endif
14081418
endfunc
14091419

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,8 @@ static char *(features[]) =
695695

696696
static int included_patches[] =
697697
{ /* Add new patch number below this line */
698+
/**/
699+
1671,
698700
/**/
699701
1670,
700702
/**/

0 commit comments

Comments
 (0)