refactor(util): unify debounce helpers into Debouncer class
This commit is contained in:
+4
-3
@@ -425,11 +425,12 @@ function Linter.add(bufnr, config)
|
||||
return
|
||||
end
|
||||
|
||||
local debouncer = util.debounce(function()
|
||||
linter:run()
|
||||
end, config.debounce)
|
||||
vim.api.nvim_create_autocmd(config.events, {
|
||||
buffer = linter.bufnr,
|
||||
callback = util.debounce(function()
|
||||
linter:run()
|
||||
end, config.debounce),
|
||||
callback = function() debouncer:call() end,
|
||||
group = linter.augroup,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user