1
0
mirror of https://github.com/amix/vimrc synced 2025-07-03 22:25:32 +08:00

Updated plugins

This commit is contained in:
Amir Salihefendic
2019-05-17 16:09:13 +02:00
parent 5a2572df03
commit fae0b73f0d
154 changed files with 3522 additions and 1370 deletions

View File

@ -209,13 +209,18 @@ endfunction
" Relative paths cannot be properly converted to a URI; when path is a
" relative path, the file scheme will not be prepended.
function! go#path#ToURI(path)
let l:absolute = !go#util#IsWin() && a:path[0] is# '/'
let l:prefix = ''
let l:path = a:path
if l:path[1:2] is# ':\'
let l:path = '/' . l:path[0:1] . l:path[3:]
if go#util#IsWin() && l:path[1:2] is# ':\'
let l:absolute = 1
let l:prefix = '/' . l:path[0:1]
let l:path = l:path[2:]
endif
return substitute(
\ (l:path[0] is# '/' ? 'file://' : '') . go#uri#EncodePath(l:path),
\ (l:absolute ? 'file://' : '') . l:prefix . go#uri#EncodePath(l:path),
\ '\\',
\ '/',
\ 'g',
@ -229,7 +234,7 @@ function! go#path#FromURI(uri) abort
let l:path = go#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]:'
if go#util#IsWin() && l:path =~# '^/[a-zA-Z]:'
let l:path = substitute(l:path[1:], '/', '\\', 'g')
endif