Display a different sign when there's a breakpoint on the PC line

Vim only renders a single sign-per-line. If we have the PC _and_ a
breakpoint, we should make that clear. Do this using a vimspectorPCBP
sign which combines both vimspectorPC and vimspectorBP (sort of).

We can't (unfortuantely) render the breakpoint blob in a different
colour, but it's at least obvious when we toggle on the PC line.
This commit is contained in:
Ben Jackson 2020-09-19 15:11:09 +01:00
commit 2ad1a3e502
5 changed files with 67 additions and 26 deletions

View file

@ -551,6 +551,7 @@ endfunction
function! Test_Custom_Breakpoint_Priority()
let g:vimspector_sign_priority = {
\ 'vimspectorPC': 1,
\ 'vimspectorPCBP': 1,
\ 'vimspectorBP': 2,
\ 'vimspectorBPCond': 3,
\ 'vimspectorBPDisabled': 4
@ -597,7 +598,7 @@ function! Test_Custom_Breakpoint_Priority()
call vimspector#test#signs#AssertSignAtLine(
\ 'VimspectorCode',
\ 15,
\ 'vimspectorPC',
\ 'vimspectorPCBP',
\ 1 )
call vimspector#test#signs#AssertSignGroupSingletonAtLine( 'VimspectorCode',
\ 17,
@ -626,7 +627,7 @@ function! Test_Custom_Breakpoint_Priority()
call vimspector#test#signs#AssertSignAtLine(
\ 'VimspectorCode',
\ 17,
\ 'vimspectorPC',
\ 'vimspectorPCBP',
\ 1 )
@ -684,7 +685,7 @@ function! Test_Custom_Breakpoint_Priority_Partial()
call vimspector#test#signs#AssertSignAtLine(
\ 'VimspectorCode',
\ 15,
\ 'vimspectorPC',
\ 'vimspectorPCBP',
\ 200 )
call vimspector#test#signs#AssertSignGroupSingletonAtLine( 'VimspectorCode',
\ 17,
@ -713,7 +714,7 @@ function! Test_Custom_Breakpoint_Priority_Partial()
call vimspector#test#signs#AssertSignAtLine(
\ 'VimspectorCode',
\ 17,
\ 'vimspectorPC',
\ 'vimspectorPCBP',
\ 200 )

View file

@ -32,7 +32,7 @@ function! vimspector#test#signs#AssertPCIsAtLineInBuffer( buffer, line ) abort
let index = 0
while index < len( signs[ 0 ].signs )
let s = signs[ 0 ].signs[ index ]
if s.name ==# 'vimspectorPC'
if s.name ==# 'vimspectorPC' || s.name ==# 'vimspectorPCBP'
if assert_false( pc_index >= 0, 'Too many PC signs' )
return 1
endif