diff --git a/autoload/SpaceVim/api/file.vim b/autoload/SpaceVim/api/file.vim index b294a2125..a429f4f65 100644 --- a/autoload/SpaceVim/api/file.vim +++ b/autoload/SpaceVim/api/file.vim @@ -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:] !=# '/' diff --git a/autoload/SpaceVim/custom.vim b/autoload/SpaceVim/custom.vim index 920995663..1c044e99d 100644 --- a/autoload/SpaceVim/custom.vim +++ b/autoload/SpaceVim/custom.vim @@ -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