From 1bc8bcaa39614663b4291f8d8df33a3acede9705 Mon Sep 17 00:00:00 2001 From: wangsn Date: Sat, 23 Mar 2024 21:59:25 +0800 Subject: [PATCH] guarding s:sign_place function to avoid exception. 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. --- autoload/go/debug.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/autoload/go/debug.vim b/autoload/go/debug.vim index b27c565e68..523f4b36e9 100644 --- a/autoload/go/debug.vim +++ b/autoload/go/debug.vim @@ -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