fix(util): refactor debouncer
This commit is contained in:
+3
-6
@@ -435,14 +435,11 @@ 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 = function()
|
||||
debouncer:call()
|
||||
end,
|
||||
callback = util.debounce(function()
|
||||
linter:run()
|
||||
end, config.debounce) --[[@as fun()]],
|
||||
group = linter.augroup,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user