mirror of https://github.com/folke/lazy.nvim.git
fix(ui): hover now opens repo url when no diff with main. Fixes #1430
This commit is contained in:
parent
d3974346b6
commit
40845063a2
|
@ -211,13 +211,13 @@ function M:restore(opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:hover()
|
function M:hover()
|
||||||
if self:diff({ browser = true }) then
|
if self:diff({ browser = true, hover = true }) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self:open_url("")
|
self:open_url("")
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param opts? {commit?:string, browser:boolean}
|
---@param opts? {commit?:string, browser:boolean, hover:boolean}
|
||||||
function M:diff(opts)
|
function M:diff(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
local plugin = self.render:get_plugin()
|
local plugin = self.render:get_plugin()
|
||||||
|
@ -231,6 +231,9 @@ function M:diff(opts)
|
||||||
local info = assert(Git.info(plugin.dir))
|
local info = assert(Git.info(plugin.dir))
|
||||||
local target = assert(Git.get_target(plugin))
|
local target = assert(Git.get_target(plugin))
|
||||||
diff = { from = info.commit, to = target.commit }
|
diff = { from = info.commit, to = target.commit }
|
||||||
|
if opts.hover and diff.from == diff.to then
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not diff then
|
if not diff then
|
||||||
|
|
Loading…
Reference in New Issue