Fixed shellslash problems in Windows
This commit is contained in:
parent
db4e2d5cf3
commit
0ad960d478
@ -128,6 +128,7 @@ function! vebugger#gdb#_readWhere(pipeName,line,readResult,debugger)
|
||||
let l:matches=matchlist(a:line,'\v^\*stopped.*fullname\=\"([^"]+)\",line\=\"(\d+)"')
|
||||
if 2<len(l:matches)
|
||||
let l:file=has('win32') ? substitute(l:matches[1], '\\\\', '\\', 'g') : l:matches[1]
|
||||
let l:file=vebugger#util#WinShellSlash(l:file)
|
||||
let l:file=fnamemodify(l:file,':p')
|
||||
let a:readResult.std.location={
|
||||
\'file':(l:file),
|
||||
|
@ -59,7 +59,7 @@ function! vebugger#pdb#_readWhere(pipeName,line,readResult,debugger)
|
||||
let l:matches=matchlist(a:line,'\v^\> (.+)\((\d+)\).*\(\)%(-\>.*)?$')
|
||||
|
||||
if 2<len(l:matches)
|
||||
let l:file=l:matches[1]
|
||||
let l:file=vebugger#util#WinShellSlash(l:matches[1])
|
||||
if !empty(glob(l:file))
|
||||
let l:line=str2nr(l:matches[2])
|
||||
let a:readResult.std.location={
|
||||
|
@ -116,6 +116,14 @@ function! vebugger#util#isPathAbsolute(path)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! vebugger#util#WinShellSlash(path)
|
||||
if has('win32') && &shellslash
|
||||
return substitute(a:path, '\\', '/', 'g')
|
||||
else
|
||||
return a:path
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user