Skip to content

Commit

Permalink
guarding s:sign_place function to avoid exception.
Browse files Browse the repository at this point in the history
when dlv started, there will be some default breakpoints created, some
of them may have no line and file information, like
"runtime-fatal-throw" breakpoint. check a:lnum and a:expr to avoid vim
excption when sync breakpoints.
  • Loading branch information
faint998 committed Mar 23, 2024
1 parent 5332cd8 commit 1bc8bca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions autoload/go/debug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1567,6 +1567,11 @@ function! s:sign_unplace(id, file) abort
endfunction

function! s:sign_place(id, expr, lnum) abort
" Check if lnum is less than 1 or expr is empty or null
if a:lnum < 1 || empty(a:expr)
return
endif

if !exists('*sign_place')
exe 'sign place ' . a:id . ' line=' . a:lnum . ' name=godebugbreakpoint file=' . a:expr
return
Expand Down

0 comments on commit 1bc8bca

Please sign in to comment.