diff --git a/autoload/vebugger/util.vim b/autoload/vebugger/util.vim index 67f4dac..3146932 100644 --- a/autoload/vebugger/util.vim +++ b/autoload/vebugger/util.vim @@ -94,3 +94,12 @@ function! vebugger#util#getToolFullPath(toolName,default) return a:default endif endfunction + +"Checks if the path is an absolute path +function! vebugger#util#isPathAbsolute(path) + if has('win32') + return a:path=~':' || a:path[0]=='%' "Absolute paths in Windows contain : or start with an environment variable + else + return a:path[0]=~'\v^[/~$]' "Absolute paths in Linux start with ~(home),/(root dir) or $(environment variable) + endif +endfunction