From 80ef7ea2d0b22f0d8de7387a3d5bf6e9e5b72e9d Mon Sep 17 00:00:00 2001 From: w0rp Date: Wed, 13 Mar 2019 16:44:29 +0000 Subject: #2357 Handle Windows paths where the drive letter colon is encoded --- autoload/ale/path.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'autoload') diff --git a/autoload/ale/path.vim b/autoload/ale/path.vim index 25193ddb..60d42eb5 100644 --- a/autoload/ale/path.vim +++ b/autoload/ale/path.vim @@ -205,11 +205,13 @@ function! ale#path#FromURI(uri) abort let l:encoded_path = a:uri endif + let l:path = ale#uri#Decode(l:encoded_path) + " If the path is like /C:/foo/bar, it should be C:\foo\bar instead. - if l:encoded_path =~# '^/[a-zA-Z][:|]' - let l:encoded_path = substitute(l:encoded_path[1:], '/', '\\', 'g') - let l:encoded_path = l:encoded_path[0] . ':' . l:encoded_path[2:] + if has('win32') && l:path =~# '^/[a-zA-Z][:|]' + let l:path = substitute(l:path[1:], '/', '\\', 'g') + let l:path = l:path[0] . ':' . l:path[2:] endif - return ale#uri#Decode(l:encoded_path) + return l:path endfunction -- cgit v1.2.3