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.
b9eb91a793
...
7afbd83a89
@ -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
|
||||
|
@ -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
|
||||
-- }}}
|
||||
|
Loading…
Reference in New Issue
Block a user