mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
fix(async): make asyncs abortable
This commit is contained in:
parent
c882227f1f
commit
1fad61712b
7 changed files with 29 additions and 8 deletions
|
@ -252,7 +252,7 @@ end
|
|||
---@param fn fun(self?)
|
||||
---@param desc? string
|
||||
---@param mode? string[]
|
||||
function M:on_key(key, fn, desc,mode)
|
||||
function M:on_key(key, fn, desc, mode)
|
||||
vim.keymap.set(mode or "n", key, function()
|
||||
fn(self)
|
||||
end, {
|
||||
|
@ -295,6 +295,7 @@ function M:close(opts)
|
|||
vim.diagnostic.reset(Config.ns, buf)
|
||||
vim.api.nvim_buf_delete(buf, { force = true })
|
||||
end
|
||||
vim.cmd.redraw()
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
@ -83,6 +83,7 @@ function M.create()
|
|||
|
||||
vim.keymap.set("n", ViewConfig.keys.abort, function()
|
||||
require("lazy.manage.process").abort()
|
||||
require("lazy.async").abort()
|
||||
return ViewConfig.keys.abort
|
||||
end, { silent = true, buffer = self.buf, expr = true })
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue