diff --git a/lua/pending/complete.lua b/lua/pending/complete.lua index 6ee3320..135d1a4 100644 --- a/lua/pending/complete.lua +++ b/lua/pending/complete.lua @@ -128,6 +128,9 @@ function M.omnifunc(findstart, base) { vim.pesc(dk) .. ':([%S]*)$', dk }, { 'cat:([%S]*)$', 'cat' }, { vim.pesc(rk) .. ':([%S]*)$', rk }, + { 'gh:([%S]*)$', 'gh' }, + { 'gl:([%S]*)$', 'gl' }, + { 'cb:([%S]*)$', 'cb' }, } for _, check in ipairs(checks) do @@ -169,6 +172,24 @@ function M.omnifunc(findstart, base) table.insert(matches, { word = c.word, menu = '[' .. source .. ']', info = c.info }) end end + elseif source == 'gh' or source == 'gl' or source == 'cb' then + local s = require('pending.buffer').store() + if s then + local seen = {} + for _, task in ipairs(s:tasks()) do + if task._extra and task._extra._forge_ref then + local ref = task._extra._forge_ref + local key = ref.owner .. '/' .. ref.repo + if not seen[key] then + seen[key] = true + local word = key .. '#' + if base == '' or word:sub(1, #base) == base then + table.insert(matches, { word = word, menu = '[' .. source .. ']' }) + end + end + end + end + end end return matches