fix bugs after upgrading to neovim 0.12
tests / test (push) Successful in 10s

This commit is contained in:
2026-05-12 08:34:04 +02:00
parent 5d205c0302
commit cb1095feeb
4 changed files with 33 additions and 33 deletions
+17 -17
View File
@@ -676,7 +676,7 @@ local function detect_js_framework(file)
end
local pkg_path = vim.fs.joinpath(root, "package.json")
local stat = vim.loop.fs_stat(pkg_path)
local stat = vim.uv.fs_stat(pkg_path)
if not stat or stat.type ~= "file" then
return nil
end
@@ -776,11 +776,11 @@ apply_border_kind = function(win, kind)
return
end
if kind == "pass" then
vim.api.nvim_win_set_option(target, "winhighlight", "FloatBorder:TestSamuraiBorderPass")
vim.wo[target].winhighlight = "FloatBorder:TestSamuraiBorderPass"
elseif kind == "fail" then
vim.api.nvim_win_set_option(target, "winhighlight", "FloatBorder:TestSamuraiBorderFail")
vim.wo[target].winhighlight = "FloatBorder:TestSamuraiBorderFail"
else
vim.api.nvim_win_set_option(target, "winhighlight", "")
vim.wo[target].winhighlight = ""
end
end
@@ -900,8 +900,8 @@ local function create_output_win(initial_lines)
local buf = state.last_buf
if not (buf and vim.api.nvim_buf_is_valid(buf)) then
buf = vim.api.nvim_create_buf(false, true)
vim.api.nvim_buf_set_option(buf, "bufhidden", "hide")
vim.api.nvim_buf_set_option(buf, "filetype", "test-samurai-output")
vim.bo[buf].bufhidden = "hide"
vim.bo[buf].filetype = "test-samurai-output"
state.last_buf = buf
end
@@ -1402,10 +1402,10 @@ local function ensure_detail_buf(lines)
local buf = state.detail_buf
if not (buf and vim.api.nvim_buf_is_valid(buf)) then
buf = vim.api.nvim_create_buf(false, true)
vim.api.nvim_buf_set_option(buf, "bufhidden", "hide")
vim.api.nvim_buf_set_option(buf, "buftype", "nofile")
vim.api.nvim_buf_set_option(buf, "swapfile", false)
vim.api.nvim_buf_set_option(buf, "filetype", "test-samurai-output")
vim.bo[buf].bufhidden = "hide"
vim.bo[buf].buftype = "nofile"
vim.bo[buf].swapfile = false
vim.bo[buf].filetype = "test-samurai-output"
state.detail_buf = buf
end
set_detail_maps(buf)
@@ -2118,7 +2118,7 @@ run_command = function(command, opts)
end
end
local cmd = command.cmd
local cwd = command.cwd or vim.loop.cwd()
local cwd = command.cwd or vim.uv.cwd()
local header = "$ " .. table.concat(cmd, " ")
local buf = nil
@@ -2147,8 +2147,8 @@ run_command = function(command, opts)
local result_counts = make_summary_tracker(true)
state.last_border_kind = "default"
local start_time = nil
if vim.loop and vim.loop.hrtime then
start_time = vim.loop.hrtime()
if vim.uv and vim.uv.hrtime then
start_time = vim.uv.hrtime()
end
local output_lines = {}
@@ -2302,8 +2302,8 @@ run_command = function(command, opts)
end
if summary_enabled then
local elapsed = nil
if start_time and vim.loop and vim.loop.hrtime then
elapsed = (vim.loop.hrtime() - start_time) / 1000000000
if start_time and vim.uv and vim.uv.hrtime then
elapsed = (vim.uv.hrtime() - start_time) / 1000000000
end
ensure_output_started()
local summary_lines = format_summary_lines(summary, elapsed)
@@ -2321,8 +2321,8 @@ run_command = function(command, opts)
end
if summary_enabled then
local elapsed = nil
if start_time and vim.loop and vim.loop.hrtime then
elapsed = (vim.loop.hrtime() - start_time) / 1000000000
if start_time and vim.uv and vim.uv.hrtime then
elapsed = (vim.uv.hrtime() - start_time) / 1000000000
end
ensure_output_started()
local summary_lines = format_summary_lines(summary, elapsed)