Merge pull request #259 from rm-hull/bugfix/handle-nREPL-stacktrace

Handle new/old nREPL stacktraces - fixes #258
This commit is contained in:
Tim Pope 2016-01-29 16:03:38 -05:00
commit 2bab337396

View File

@ -182,7 +182,12 @@ endfunction
function! s:extract_last_stacktrace(nrepl, session) abort function! s:extract_last_stacktrace(nrepl, session) abort
if a:nrepl.has_op('stacktrace') if a:nrepl.has_op('stacktrace')
let stacktrace = filter(a:nrepl.message({'op': 'stacktrace', 'session': a:session}), 'has_key(v:val, "file")') let stacktrace = a:nrepl.message({'op': 'stacktrace', 'session': a:session})
if len(stacktrace) > 0 && has_key(stacktrace[0], 'stacktrace')
let stacktrace = stacktrace[0].stacktrace
endif
call filter(stacktrace, 'has_key(v:val, "file")')
if !empty(stacktrace) if !empty(stacktrace)
return map(stacktrace, 'v:val.class.".".v:val.method."(".v:val.file.":".v:val.line.")"') return map(stacktrace, 'v:val.class.".".v:val.method."(".v:val.file.":".v:val.line.")"')
endif endif