mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 22:40:06 +08:00
fix(projectmanager): remove log info
This commit is contained in:
parent
d3a2916dc8
commit
665727ada3
@ -200,6 +200,7 @@ function! SpaceVim#autocmds#VimEnter() abort
|
||||
call SpaceVim#layers#core#tabline#def_colors()
|
||||
set showtabline=2
|
||||
endif
|
||||
call SpaceVim#logger#info('run root changed callback on VimEnter!')
|
||||
call SpaceVim#plugins#projectmanager#RootchandgeCallback()
|
||||
if !empty(get(g:, '_spacevim_bootstrap_after', ''))
|
||||
try
|
||||
|
@ -139,11 +139,11 @@ 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
|
||||
if dir ~= nil then
|
||||
logger.info('change to root: ' .. dir)
|
||||
sp.cmd(cd .. ' ' .. sp.fn.fnameescape(sp.fn.fnamemodify(dir, ':p')))
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
@ -170,14 +170,14 @@ end
|
||||
|
||||
local function find_root_directory()
|
||||
local fd = fn.bufname('%')
|
||||
if fn == '' then
|
||||
logger.debug('bufname is empty')
|
||||
if fd == '' then
|
||||
logger.debug('bufname is empty, use current directory instead!')
|
||||
fd = fn.getcwd()
|
||||
end
|
||||
logger.debug('start to find root for: ' .. fd)
|
||||
local dirs = {}
|
||||
logger.debug('searching rooter_patterns:' .. vim.inspect(project_rooter_patterns))
|
||||
for _, pattern in pairs(project_rooter_patterns) do
|
||||
logger.debug('searching rooter_patterns:' .. pattern)
|
||||
local find_path = ''
|
||||
if string.sub(pattern, -1) == '/' then
|
||||
if sp_opt.project_rooter_outermost == 1 then
|
||||
@ -382,8 +382,9 @@ function M.current_root()
|
||||
end
|
||||
fn.setbufvar('%', 'rootDir', rootdir)
|
||||
end
|
||||
change_dir(rootdir)
|
||||
if change_dir(rootdir) then
|
||||
M.RootchandgeCallback()
|
||||
end
|
||||
return rootdir
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user