Use apply_text_edits to avoid making the unexpected indentation by '<CR>'

This commit is contained in:
hrsh7th
2021-11-05 21:13:47 +09:00
parent 9734453d77
commit e1f880b7e0
3 changed files with 118 additions and 95 deletions

View File

@@ -35,6 +35,18 @@ async.throttle = function(fn, timeout)
})
end
---Control async tasks.
async.step = function(...)
local tasks = { ... }
local next
next = function()
if #tasks > 0 then
table.remove(tasks, 1)(next)
end
end
table.remove(tasks, 1)(next)
end
---Timeout callback function
---@param fn function
---@param timeout number