mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 11:20:06 +08:00
feat(git): update git-tag completion
This commit is contained in:
parent
9584d22101
commit
0d66e31934
@ -72,12 +72,16 @@ function M.run(argv)
|
||||
end
|
||||
end
|
||||
|
||||
local function get_all_tags()
|
||||
return vim.fn.systemlist('git tag')
|
||||
end
|
||||
|
||||
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'}, '\n')
|
||||
return table.concat({'--list', '-l', '-m', '-a', '-d'}, '\n')
|
||||
else
|
||||
return ''
|
||||
return table.concat(get_all_tags(), '\n')
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user