From 5865e3b28e1f079c16c45437a6eb1dc773439a05 Mon Sep 17 00:00:00 2001 From: Dalton Barreto Date: Mon, 16 Oct 2017 20:11:15 -0200 Subject: [PATCH] Adding support for srcpath as string or list --- autoload/vebugger/jdb.vim | 2 +- autoload/vebugger/util.vim | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/autoload/vebugger/jdb.vim b/autoload/vebugger/jdb.vim index 64a7622..bd4adc7 100644 --- a/autoload/vebugger/jdb.vim +++ b/autoload/vebugger/jdb.vim @@ -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) diff --git a/autoload/vebugger/util.vim b/autoload/vebugger/util.vim index 2db1d12..b05ab50 100644 --- a/autoload/vebugger/util.vim +++ b/autoload/vebugger/util.vim @@ -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 +