1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 03:00:06 +08:00

Fix resolve test

This commit is contained in:
Shidong Wang 2021-02-17 14:44:41 +08:00
parent f05cb610fa
commit ddeb8105dc
2 changed files with 3 additions and 2 deletions

View File

@ -228,12 +228,13 @@ endfunction
let s:file['updateFiles'] = function('s:updatefiles')
" this function should return a unify path
" This function will run resolve too
" 1. the sep is /
" 2. if it is a dir, end with /
" 3. if a:path end with /, then return path also end with /
function! s:unify_path(path, ...) abort
let mod = a:0 > 0 ? a:1 : ':p'
let path = resolve(fnamemodify(a:path, mod . ':gs?[\\/]?/?'))
let path = s:vim_comp.resolve(fnamemodify(a:path, mod . ':gs?[\\/]?/?'))
if isdirectory(path) && path[-1:] !=# '/'
return path . '/'
elseif a:path[-1:] ==# '/' && path[-1:] !=# '/'

View File

@ -62,7 +62,7 @@ endfunction
function! s:global_dir() abort
if empty($SPACEVIMDIR)
return s:FILE.unify_path(s:CMP.resolve(expand('~/.SpaceVim.d/')))
return s:FILE.unify_path('~/.SpaceVim.d/')
else
return s:FILE.unify_path($SPACEVIMDIR)
endif