mirror of
https://github.com/amix/vimrc
synced 2025-07-25 05:54:59 +08:00
Updated plugins
This commit is contained in:
@ -197,15 +197,18 @@ function! ale#path#ToURI(path) abort
|
||||
endfunction
|
||||
|
||||
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
|
||||
|
||||
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')
|
||||
if a:uri[:6] is? 'file://'
|
||||
let l:encoded_path = a:uri[7:]
|
||||
elseif a:uri[:4] is? 'file:'
|
||||
let l:encoded_path = a:uri[5:]
|
||||
else
|
||||
let l:encoded_path = a:uri
|
||||
endif
|
||||
|
||||
return l: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')
|
||||
endif
|
||||
|
||||
return ale#uri#Decode(l:encoded_path)
|
||||
endfunction
|
||||
|
Reference in New Issue
Block a user