1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:50:05 +08:00

Compare commits

..

No commits in common. "b9eb91a793ad0217e5d694a7ccc31fb2794872a3" and "7afbd83a89816511a140926a7dd9b221c842146a" have entirely different histories.

2 changed files with 1 additions and 8 deletions

View File

@ -6,6 +6,7 @@ local log = require('git.log')
local str = require('spacevim.api.data.string')
local branch_ui = require('git.ui.branch')
local branch = ''
local branch_info = {}
local job_pwds = {}
@ -20,7 +21,6 @@ local function on_stdout_show_branch(id, data)
end
local function on_exit_show_branch(id, code, single)
log.debug('git-branch exit code:' .. code .. ' single:' .. single)
local pwd = job_pwds['jobid' .. id] or ''
if branch_info[pwd] == nil and #pwd > 0 then
branch_info[pwd] = {}
@ -41,13 +41,11 @@ local function update_branch_name(pwd, ...)
or vim.fn.get(vim.fn.get(branch_info, pwd, {}), 'last_update_done', 0)
<= vim.fn.localtime() - 1
then
log.debug('git branch cmd:' .. vim.inspect(cmd))
local jobid = job.start(cmd, {
on_stdout = on_stdout_show_branch,
on_exit = on_exit_show_branch,
cwd = pwd,
})
log.debug('git branch jobid:' .. jobid)
if jobid > 0 then
job_pwds['jobid' .. jobid] = pwd
end

View File

@ -57,11 +57,6 @@ local function enter(f) -- {{{
else
pcall(f)
end
elseif copt.auto_completion_return_key_behavior == 'nil' then
if cmp.visible() then
cmp.close()
end
pcall(f)
end
end
-- }}}