summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-20 00:02:33 +0000
committerw0rp <devw0rp@gmail.com>2017-11-20 00:02:33 +0000
commit9420c411bda14348a435a76bb415a3081940b285 (patch)
tree87696c4c84684f2873b77032d74d835ca751d373 /autoload
parent597507e5197ef51037d01d30ad819a048eea9c9b (diff)
downloadale-9420c411bda14348a435a76bb415a3081940b285.zip
#1149 Fix conversion from URIs to filenames on Windows
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/path.vim9
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