fix(window): set correct window size for lazygit to render (#158)

since `open_floating_window` use async way `vim.defer_fn` to create
window, `lazygit` executed with a sync way of `vim.fn.jobstart` in
`exec_lazygit_command`, it can't get the floating window size at the
banging

before:


https://github.com/user-attachments/assets/771b4099-c398-42b4-a80f-367f2d1305e7



after:


https://github.com/user-attachments/assets/12cb7381-625c-49c3-bf61-0e385ce79c76
This commit is contained in:
HyBer
2025-07-22 19:16:27 +08:00
committed by GitHub
parent 541bc0d46e
commit 8797c0df3f

View File

@@ -59,7 +59,9 @@ local function exec_lazygit_command(cmd)
command = cmd
end
vim.schedule(function()
vim.fn.jobstart(command, { term = true, on_exit = on_exit })
end)
end
vim.cmd("startinsert")
end