mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-20 05:16:45 +00:00
fix(ui): when closing details, jump to plugin header. Closes #1338
This commit is contained in:
parent
5bddef2415
commit
3772914075
2 changed files with 20 additions and 1 deletions
|
@ -96,7 +96,17 @@ function M.create()
|
|||
name = plugin.name,
|
||||
kind = plugin._.kind,
|
||||
}
|
||||
self.state.plugin = not vim.deep_equal(self.state.plugin, selected) and selected or nil
|
||||
|
||||
local open = not vim.deep_equal(self.state.plugin, selected)
|
||||
|
||||
if not open then
|
||||
local row = self.render:get_row(selected)
|
||||
if row then
|
||||
vim.api.nvim_win_set_cursor(self.view.win, { row, 8 })
|
||||
end
|
||||
end
|
||||
|
||||
self.state.plugin = open and selected or nil
|
||||
self:update()
|
||||
end
|
||||
end)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue