documentation
This commit is contained in:
parent
5d5587b22f
commit
d974567a8d
3 changed files with 123 additions and 54 deletions
|
|
@ -31,14 +31,6 @@ function M.check()
|
|||
table.insert(missing, lang)
|
||||
end
|
||||
end
|
||||
|
||||
if #available > 0 then
|
||||
vim.health.ok('Treesitter parsers available: ' .. table.concat(available, ', '))
|
||||
end
|
||||
|
||||
if #missing > 0 then
|
||||
vim.health.info('Treesitter parsers not installed: ' .. table.concat(missing, ', '))
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -75,19 +75,28 @@ end
|
|||
---@param bufnr integer
|
||||
---@return fun()
|
||||
local function create_debounced_highlight(bufnr)
|
||||
---@type uv_timer_t?
|
||||
local timer = nil
|
||||
return function()
|
||||
if timer then
|
||||
timer:stop() ---@diagnostic disable-line: undefined-field
|
||||
timer:close() ---@diagnostic disable-line: undefined-field
|
||||
timer:stop()
|
||||
timer:close()
|
||||
timer = nil
|
||||
end
|
||||
timer = vim.uv.new_timer()
|
||||
timer:start(
|
||||
local t = vim.uv.new_timer()
|
||||
if not t then
|
||||
highlight_buffer(bufnr)
|
||||
return
|
||||
end
|
||||
timer = t
|
||||
t:start(
|
||||
config.debounce_ms,
|
||||
0,
|
||||
vim.schedule_wrap(function()
|
||||
timer:close()
|
||||
timer = nil
|
||||
t:close()
|
||||
if timer == t then
|
||||
timer = nil
|
||||
end
|
||||
highlight_buffer(bufnr)
|
||||
end)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue