#729 - Use a wrapper for simplify to fix // problems on Windows

This commit is contained in:
w0rp
2017-07-05 15:51:31 +01:00
parent a04e73ddbc
commit 1bd9b0fbe2
6 changed files with 25 additions and 9 deletions

View File

@@ -28,10 +28,15 @@ endfunction
" Given a buffer number, find a virtualenv path for Python.
function! ale#python#FindVirtualenv(buffer) abort
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
for l:dirname in ale#Var(a:buffer, 'virtualenv_dir_names')
let l:venv_dir = simplify(l:path . '/' . l:dirname)
" Skip empty path components returned in MSYS.
if empty(l:path)
continue
endif
if filereadable(simplify(l:venv_dir . '/' . s:bin_dir . '/activate'))
for l:dirname in ale#Var(a:buffer, 'virtualenv_dir_names')
let l:venv_dir = ale#path#Simplify(l:path . '/' . l:dirname)
if filereadable(ale#path#Simplify(l:venv_dir . '/' . s:bin_dir . '/activate'))
return l:venv_dir
endif
endfor
@@ -52,7 +57,7 @@ function! ale#python#FindExecutable(buffer, base_var_name, path_list) abort
if !empty(l:virtualenv)
for l:path in a:path_list
let l:ve_executable = simplify(l:virtualenv . '/' . s:bin_dir . '/' . l:path)
let l:ve_executable = ale#path#Simplify(l:virtualenv . '/' . s:bin_dir . '/' . l:path)
if executable(l:ve_executable)
return l:ve_executable