mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
fix(clipboard): make osc52 work with PUC Lua (#26014)
This commit is contained in:
parent
d65c574ca3
commit
d2983dcdb1
@ -2,7 +2,7 @@ local M = {}
|
|||||||
|
|
||||||
function M.copy(lines)
|
function M.copy(lines)
|
||||||
local s = table.concat(lines, '\n')
|
local s = table.concat(lines, '\n')
|
||||||
io.stdout:write(string.format('\x1b]52;;%s\x1b\\', vim.base64.encode(s)))
|
io.stdout:write(string.format('\027]52;;%s\027\\', vim.base64.encode(s)))
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.paste()
|
function M.paste()
|
||||||
@ -10,7 +10,7 @@ function M.paste()
|
|||||||
local id = vim.api.nvim_create_autocmd('TermResponse', {
|
local id = vim.api.nvim_create_autocmd('TermResponse', {
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local resp = args.data ---@type string
|
local resp = args.data ---@type string
|
||||||
local encoded = resp:match('\x1b%]52;%w?;([A-Za-z0-9+/=]*)')
|
local encoded = resp:match('\027%]52;%w?;([A-Za-z0-9+/=]*)')
|
||||||
if encoded then
|
if encoded then
|
||||||
contents = vim.base64.decode(encoded)
|
contents = vim.base64.decode(encoded)
|
||||||
return true
|
return true
|
||||||
@ -18,7 +18,7 @@ function M.paste()
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
io.stdout:write('\x1b]52;;?\x1b\\')
|
io.stdout:write('\027]52;;?\027\\')
|
||||||
|
|
||||||
local ok, res
|
local ok, res
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user