1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 06:30:03 +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') let s:file['updateFiles'] = function('s:updatefiles')
" this function should return a unify path " this function should return a unify path
" This function will run resolve too
" 1. the sep is / " 1. the sep is /
" 2. if it is a dir, end with / " 2. if it is a dir, end with /
" 3. if a:path end with /, then return path also end with / " 3. if a:path end with /, then return path also end with /
function! s:unify_path(path, ...) abort function! s:unify_path(path, ...) abort
let mod = a:0 > 0 ? a:1 : ':p' 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:] !=# '/' if isdirectory(path) && path[-1:] !=# '/'
return path . '/' return path . '/'
elseif a:path[-1:] ==# '/' && path[-1:] !=# '/' elseif a:path[-1:] ==# '/' && path[-1:] !=# '/'

View File

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