runtime(termdebug): improve the breakpoint sign label (#13525)
// related #12589
// that should be the last chat (I) with Bram, r.i.p
Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt
index 68528d3..3869bcd 100644
--- a/runtime/doc/terminal.txt
+++ b/runtime/doc/terminal.txt
@@ -1588,9 +1588,9 @@
Change default signs ~
*termdebug_signs*
-Termdebug uses the last two characters of the breakpoint ID in the
-signcolumn to represent breakpoints. For example, breakpoint ID 133
-will be displayed as `33`.
+Termdebug uses the hex number of the breakpoint ID in the signcolumn to
+represent breakpoints. if it is greater than "0xFF", then it will be displayed
+as "F+", due to we really only have two screen cells for the sign.
If you want to customize the breakpoint signs: >
let g:termdebug_config['sign'] = '>>'
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index 6d8e483..e764c23 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -1648,9 +1648,9 @@
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)
+ let label = printf('%02X', a:id)
+ if a:id > 255
+ let label = 'F+'
endif
endif
call sign_define('debugBreakpoint' .. nr,