mirror of
https://github.com/folke/snacks.nvim
synced 2025-07-07 13:15:08 +00:00
fix(image.terminal): write queued terminal output on main
This commit is contained in:
parent
4c52b7f25d
commit
1b63b1811c
1 changed files with 9 additions and 6 deletions
|
@ -54,12 +54,15 @@ vim.api.nvim_create_autocmd("VimResized", {
|
|||
-- HACK: ghostty doesn't like it when sending images too fast,
|
||||
-- after Neovim startup, so we delay the first image
|
||||
local queue = {} ---@type string[]?
|
||||
vim.defer_fn(function()
|
||||
if queue and #queue > 0 then
|
||||
io.stdout:write(table.concat(queue, ""))
|
||||
end
|
||||
queue = nil
|
||||
end, 100)
|
||||
vim.defer_fn(
|
||||
vim.schedule_wrap(function()
|
||||
for _, data in ipairs(queue or {}) do
|
||||
io.stdout:write(data)
|
||||
end
|
||||
queue = nil
|
||||
end),
|
||||
100
|
||||
)
|
||||
|
||||
function M.size()
|
||||
if size then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue