1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-23 09:21:26 +08:00

Fix configuration file path (#4200)

This commit is contained in:
Wang Shidong 2021-05-31 23:30:44 +08:00 committed by GitHub
parent 8c6a828986
commit 738dbdf580
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,18 +228,30 @@ 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 " CHANGED: This function will not run resolve
" 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
call SpaceVim#logger#info('a:path is :' . a:path)
let mod = a:0 > 0 ? a:1 : ':p' let mod = a:0 > 0 ? a:1 : ':p'
let path = s:vim_comp.resolve(fnamemodify(a:path, mod . ':gs?[\\/]?/?')) let path = fnamemodify(a:path, mod . ':gs?[\\/]?/?')
call SpaceVim#logger#info('a:path is :' . a:path)
call SpaceVim#logger#info('path is :' . path)
if isdirectory(path) && path[-1:] !=# '/' if isdirectory(path) && path[-1:] !=# '/'
call SpaceVim#logger#info('case one')
call SpaceVim#logger#info('a:path is :' . a:path)
call SpaceVim#logger#info('path is :' . path)
return path . '/' return path . '/'
elseif a:path[-1:] ==# '/' && path[-1:] !=# '/' elseif a:path[-1:] ==# '/' && path[-1:] !=# '/'
call SpaceVim#logger#info('case two')
call SpaceVim#logger#info('a:path is :' . a:path)
call SpaceVim#logger#info('path is :' . path)
return path . '/' return path . '/'
else else
call SpaceVim#logger#info('case three')
call SpaceVim#logger#info('a:path is :' . a:path)
call SpaceVim#logger#info('path is :' . path)
return path return path
endif endif
endfunction endfunction