Skip to content

Commit 3ecb3fb

Browse files
committed
vital: detect the function that positioned last of the stack
1 parent 1eaaa4a commit 3ecb3fb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

autoload/vital/vital.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,18 @@ let s:Vital._import = function('s:_import')
167167

168168
function! s:_format_throwpoint(throwpoint) abort
169169
let funcs = []
170-
let stack = matchstr(a:throwpoint, '^function \zs.*\ze, line \d\+$')
170+
let stack = matchstr(a:throwpoint, '^function \zs.*, .\{-} \d\+$')
171171
for line in split(stack, '\.\.')
172-
let m = matchlist(line, '^\%(<SNR>\(\d\+\)_\)\?\(.\+\)\[\(\d\+\)\]$')
172+
let m = matchlist(line, '^\(.\+\)\%(\[\(\d\+\)\]\|, .\{-} \(\d\+\)\)$')
173173
if empty(m)
174174
call add(funcs, line)
175175
continue
176176
endif
177-
let [sid, name, lnum] = m[1:3]
178-
let attr = ''
179-
if !empty(sid)
180-
let name = printf('<SNR>%d_%s', sid, name)
177+
let [name, lnum, lnum2] = m[1:3]
178+
if empty(lnum)
179+
let lnum = lnum2
181180
endif
181+
let attr = ''
182182
let file = s:_get_file_by_func_name(name)
183183
call add(funcs, printf('function %s(...)%s Line:%d (%s)', name, attr, lnum, file))
184184
endfor

0 commit comments

Comments
 (0)