mirror of
https://github.com/neovim/neovim.git
synced 2026-01-04 10:26:42 +10:00
feat(tui): add nvim_ui_send (#35406)
This function allows the Nvim core to write arbitrary data to a TTY connected to a UI's stdout.
This commit is contained in:
@@ -14,8 +14,7 @@ function M.copy(reg)
|
||||
return function(lines)
|
||||
local s = table.concat(lines, '\n')
|
||||
-- The data to be written here can be quite long.
|
||||
-- Use nvim_chan_send() as io.stdout:write() doesn't handle EAGAIN. #26688
|
||||
vim.api.nvim_chan_send(2, osc52(clipboard, vim.base64.encode(s)))
|
||||
vim.api.nvim_ui_send(osc52(clipboard, vim.base64.encode(s)))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,7 +33,7 @@ function M.paste(reg)
|
||||
end,
|
||||
})
|
||||
|
||||
io.stdout:write(osc52(clipboard, '?'))
|
||||
vim.api.nvim_ui_send(osc52(clipboard, '?'))
|
||||
|
||||
local ok, res
|
||||
|
||||
|
||||
Reference in New Issue
Block a user