mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 19:46:58 -04:00
added attach async
This commit is contained in:
parent
b441f257a4
commit
e0b49a9a18
2 changed files with 14 additions and 1 deletions
|
|
@ -141,4 +141,15 @@ function M.index_of(tbl, obj)
|
|||
end
|
||||
end
|
||||
|
||||
function M.async(f)
|
||||
return function(...)
|
||||
local handle
|
||||
handle = vim.loop.new_async(vim.schedule_wrap(function(...)
|
||||
f(...)
|
||||
handle:close()
|
||||
end))
|
||||
handle:send(...)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue