mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-09 21:12:31 +08:00
Get the mcsc handler tests to pass on Windows
This commit is contained in:
@@ -9,14 +9,22 @@ endfunction
|
||||
|
||||
" This function is mainly used for testing.
|
||||
" Simplify() a path, and change forward slashes to back slashes on Windows.
|
||||
function! ale#path#Winify(path) abort
|
||||
let l:simplified_path = ale#path#Simplify(a:path)
|
||||
"
|
||||
" If an additional 'add_drive' argument is given, the current drive letter
|
||||
" will be prefixed to any absolute paths on Windows.
|
||||
function! ale#path#Winify(path, ...) abort
|
||||
let l:new_path = ale#path#Simplify(a:path)
|
||||
|
||||
if has('win32')
|
||||
return substitute(l:simplified_path, '/', '\\', 'g')
|
||||
let l:new_path = substitute(l:new_path, '/', '\\', 'g')
|
||||
|
||||
" Add a drive letter to \foo\bar paths, if needed.
|
||||
if a:0 && a:1 is# 'add_drive' && l:new_path[:0] is# '\'
|
||||
let l:new_path = fnamemodify('.', ':p')[:1] . l:new_path
|
||||
endif
|
||||
endif
|
||||
|
||||
return l:simplified_path
|
||||
return l:new_path
|
||||
endfunction
|
||||
|
||||
" Given a buffer and a filename, find the nearest file by searching upwards
|
||||
|
||||
Reference in New Issue
Block a user