mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-31 08:34:30 +08:00
#729 - Use a wrapper for simplify to fix // problems on Windows
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user