1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-14 01:57:58 +08:00

feat(rebase): complete after :Git rebase

This commit is contained in:
Eric Wong 2025-02-03 14:01:06 +08:00
parent 3829f764fa
commit 21315be59f
No known key found for this signature in database
GPG Key ID: 41BB7053E835C848
3 changed files with 108 additions and 98 deletions

View File

@ -119,6 +119,8 @@ function! git#complete(ArgLead, CmdLine, CursorPos) abort
return git#reflog#complete(a:ArgLead, a:CmdLine, a:CursorPos)
elseif str =~# '^Git\s\+clean\s\+.*$'
return git#clean#complete(a:ArgLead, a:CmdLine, a:CursorPos)
elseif str =~# '^Git\s\+rebase\s\+.*$'
return git#rebase#complete(a:ArgLead, a:CmdLine, a:CursorPos)
else
return ''
endif

View File

@ -1,3 +1,8 @@
if has('nvim-0.9.0')
function! git#rebase#complete(ArgLead, CmdLine, CursorPos) abort
return luaeval('require("git.command.rebase").complete(vim.api.nvim_eval("a:ArgLead"), vim.api.nvim_eval("a:CmdLine"), vim.api.nvim_eval("a:CursorPos"))')
endfunction
else
let s:JOB = SpaceVim#api#import('job')
let s:BUFFER = SpaceVim#api#import('vim#buffer')
" @todo rewrite Git rebase in lua
@ -101,4 +106,4 @@ function! s:on_rebase_continue(id, data, event) abort
echo 'failed!'
endif
endfunction
endif

View File

@ -135,5 +135,8 @@ function m.run(argv)
on_stderr = on_std,
})
end
function m.complete(ArgLead, CmdLine, CursorPos)
return table.concat({'-i', '--abort'}, '\n')
end
return m