1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-09 09:50:06 +08:00

perf(projectmanager): improve projectmanager log format

This commit is contained in:
wsdjeg 2022-10-29 14:47:29 +08:00
parent c25c711d50
commit a6baae5924

View File

@ -138,10 +138,8 @@ local function compare_time(d1, d2)
end
local function change_dir(dir)
if dir == sp_file.unify_path(fn.getcwd()) then
logger.debug('same as current directory, no need to change.')
return false
else
logger.info('change to root: ' .. dir)
sp.cmd(cd .. ' ' .. sp.fn.fnameescape(sp.fn.fnamemodify(dir, ':p')))
return true
end
@ -297,10 +295,11 @@ function M.current_name()
end
function M.RootchandgeCallback()
-- this function only will be called when switch to other project.
local path = sp_file.unify_path(fn.getcwd(), ':p')
local name = fn.fnamemodify(path, ':h:t')
logger.debug('project name is:' .. name)
logger.debug('project path is:' .. path)
logger.info('switch to project:[' .. name .. ']')
logger.info(' rootdir is:' .. path)
local project = {
['path'] = path,
['name'] = name,