fix(git/status_view): scope dispatch to current tabpage + test cleanup

This commit is contained in:
2026-05-08 03:12:41 +02:00
parent 867b5c2a2e
commit ebfcaef240
8 changed files with 217 additions and 154 deletions
+19 -2
View File
@@ -138,10 +138,27 @@ end
---@param content string
function M.write(dir, path, content)
local full = vim.fs.joinpath(dir, path)
vim.fn.mkdir(vim.fs.dirname(full), "p")
local f = assert(io.open(full --[[@as string]], "w"))
local parent = vim.fs.dirname(full)
vim.fn.mkdir(parent, "p")
local f, err = io.open(full, "w")
if not f then
error(err or "io.open failed: " .. full)
end
f:write(content)
f:close()
end
---@param keys string
function M.press(keys)
local rhs = vim.api.nvim_replace_termcodes(keys, true, false, true)
vim.api.nvim_feedkeys(rhs, "x", false)
end
---@param cond fun(): boolean
---@param msg string
---@param timeout integer?
function M.wait_for(cond, msg, timeout)
M.truthy(vim.wait(timeout or 1000, cond), "timed out waiting for: " .. msg)
end
return M