Adding support for srcpath as string or list

This commit is contained in:
Dalton Barreto 2017-10-16 20:11:15 -02:00
parent 4230773e7e
commit 5865e3b28e
No known key found for this signature in database
GPG Key ID: 05570C19E57F6BB4
2 changed files with 10 additions and 1 deletions

View File

@ -87,7 +87,7 @@ function! s:findFolderFromStackTrace(src,nameFromStackTrace,frameNumber)
endif
" If no such tag was found, try to find it using the src path.
for l:one_path in split(a:src, ':')
for l:one_path in vebugger#util#listify(a:src)
let l:path=l:one_path
for l:dirname in split(a:nameFromStackTrace,'\.')
let l:nextPath=l:path.'/'.fnameescape(l:dirname)

View File

@ -115,3 +115,12 @@ function! vebugger#util#isPathAbsolute(path)
return a:path[0]=~'\v^[/~$]' "Absolute paths in Linux start with ~(home),/(root dir) or $(environment variable)
endif
endfunction
function! vebugger#util#listify(stringOrList)
if type(a:stringOrList) == type([])
return copy(a:stringOrList) " so it could safely be modified by map&filter
else
return [a:stringOrList]
endif
endfunction