Use apply_text_edits to avoid making the unexpected indentation by '<CR>'
This commit is contained in:
@@ -40,4 +40,30 @@ describe('utils.async', function()
|
||||
end)
|
||||
assert.is.truthy(math.abs(vim.loop.now() - now) < 10)
|
||||
end)
|
||||
it('step', function()
|
||||
local done = false
|
||||
local step = {}
|
||||
async.step(function(next)
|
||||
vim.defer_fn(function()
|
||||
table.insert(step, 1)
|
||||
next()
|
||||
end, 10)
|
||||
end, function(next)
|
||||
vim.defer_fn(function()
|
||||
table.insert(step, 2)
|
||||
next()
|
||||
end, 10)
|
||||
end, function(next)
|
||||
vim.defer_fn(function()
|
||||
table.insert(step, 3)
|
||||
next()
|
||||
end, 10)
|
||||
end, function()
|
||||
done = true
|
||||
end)
|
||||
vim.wait(1000, function()
|
||||
return done
|
||||
end)
|
||||
assert.are.same(step, { 1, 2, 3 })
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user