mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-04-14 15:19:12 +08:00
fix(git): complete tags only after -d
opt
This commit is contained in:
parent
0d66e31934
commit
71c3ac19e0
@ -5,6 +5,12 @@
|
||||
" >
|
||||
" :Git tag --list
|
||||
" <
|
||||
"
|
||||
" @subsection Command line completion
|
||||
"
|
||||
" complete git tag options after `Git tag -<cursor>`,
|
||||
"
|
||||
" complete git tags after `-d` option.
|
||||
|
||||
if has('nvim-0.9.0')
|
||||
function! git#tag#complete(ArgLead, CmdLine, CursorPos) abort
|
||||
|
@ -121,6 +121,12 @@ This commands is to run `git tag` commands.
|
||||
:Git tag --list
|
||||
<
|
||||
|
||||
COMMAND LINE COMPLETION
|
||||
|
||||
complete git tag options after `Git tag -<cursor>`,
|
||||
|
||||
complete git tags after `-d` option.
|
||||
|
||||
==============================================================================
|
||||
FUNCTIONS *git-functions*
|
||||
|
||||
|
@ -80,8 +80,10 @@ function M.complete(ArgLead, CmdLine, CursorPos)
|
||||
local str = string.sub(CmdLine, 1, CursorPos)
|
||||
if vim.regex([[^Git\s\+tag\s\+-\+$]]):match_str(str) then
|
||||
return table.concat({'--list', '-l', '-m', '-a', '-d'}, '\n')
|
||||
else
|
||||
elseif vim.regex([[^Git\s\+tag\s\+.*-d\s\+[^ -]*$]]):match_str(str) then
|
||||
return table.concat(get_all_tags(), '\n')
|
||||
else
|
||||
return ''
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user