Something went wrong. Try again.
jujutsu file annotations for neovim (like blame)
Something went wrong. Try again.
880 B · 32 lines
Lua
at master
123456789101112131415161718192021222324252627282930313233local M = {}
---@type fun(msg: string, level: integer)M.notify = vim.schedule_wrap( function(msg, level) vim.notify(msg, level, { title = "jjannotate.nvim" }) end)
---@param subject string---@param revision jjannotate.RevisionRef---@return stringfunction M.revision_uri(subject, revision) return string.format( "jjannotate://%s/%s/%s?repo=%s", subject, revision.change_id, revision.path, revision.repo )end
---@param subject string---@param uri string---@return jjannotate.RevisionRef?function M.parse_uri(subject, uri) local _, _, change_id, rest = uri:find(string.format("jjannotate://%s/([^/]+)/(.+)", subject)) if not change_id or not rest then return nil end local path, repo = rest:match("^(.+)%?repo=(.+)$") if not path or not repo then return nil end return { repo = repo, change_id = change_id, path = path }end
return M