diff options
author | w0rp <devw0rp@gmail.com> | 2017-11-20 00:02:33 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-11-20 00:02:33 +0000 |
commit | 9420c411bda14348a435a76bb415a3081940b285 (patch) | |
tree | 87696c4c84684f2873b77032d74d835ca751d373 /autoload | |
parent | 597507e5197ef51037d01d30ad819a048eea9c9b (diff) | |
download | ale-9420c411bda14348a435a76bb415a3081940b285.zip |
#1149 Fix conversion from URIs to filenames on Windows
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/path.vim | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/autoload/ale/path.vim b/autoload/ale/path.vim index 83f6e85d..bca0fe81 100644 --- a/autoload/ale/path.vim +++ b/autoload/ale/path.vim @@ -185,5 +185,12 @@ function! ale#path#FromURI(uri) abort let l:i = len('file://') let l:encoded_path = a:uri[: l:i - 1] is# 'file://' ? a:uri[l:i :] : a:uri - return ale#uri#Decode(l:encoded_path) + 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:path =~# '^/[a-zA-Z]:' + let l:path = substitute(l:path[1:], '/', '\\', 'g') + endif + + return l:path endfunction |