|
1 | 1 | local api = vim.api |
| 2 | +local uv = vim.uv or vim.loop |
2 | 3 | local notify = require("quicktest.notify") |
3 | 4 | local a = require("plenary.async") |
4 | 5 | local u = require("plenary.async.util") |
@@ -155,15 +156,15 @@ function M.run(adapter, params, config, opts) |
155 | 156 | local printer = colorized_printer.new() |
156 | 157 |
|
157 | 158 | --- @type CmdJob |
158 | | - local job = { id = math.random(10000000000000000), started_at = vim.uv.now(), status = "running" } |
| 159 | + local job = { id = math.random(10000000000000000), started_at = uv.now(), status = "running" } |
159 | 160 | current_job = job |
160 | 161 |
|
161 | 162 | local is_running = function() |
162 | 163 | return current_job and job.id == current_job.id and current_job.status == "running" |
163 | 164 | end |
164 | 165 |
|
165 | 166 | local print_buf_status = function(buf, line_count) |
166 | | - local passedTime = vim.loop.now() - job.started_at |
| 167 | + local passedTime = uv.now() - job.started_at |
167 | 168 | if job.finished_at then |
168 | 169 | passedTime = job.finished_at - job.started_at |
169 | 170 | end |
@@ -322,7 +323,7 @@ function M.run(adapter, params, config, opts) |
322 | 323 |
|
323 | 324 | if result.type == "exit" then |
324 | 325 | job.exit_code = result.code |
325 | | - job.finished_at = vim.uv.now() |
| 326 | + job.finished_at = uv.now() |
326 | 327 | job.status = "finished" |
327 | 328 |
|
328 | 329 | if adapter.after_run then |
@@ -486,7 +487,7 @@ function M.kill_current_run() |
486 | 487 | vim.system({ "kill", tostring(current_job.pid) }):wait() |
487 | 488 |
|
488 | 489 | job.status = "canceled" |
489 | | - job.finished_at = vim.uv.now() |
| 490 | + job.finished_at = uv.now() |
490 | 491 | end |
491 | 492 | end |
492 | 493 |
|
|
0 commit comments