mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-04-14 15:19:12 +08:00
fix(pastebin): change url on stdout
This commit is contained in:
parent
4a8a6f76f0
commit
0cb4dc5b06
@ -66,19 +66,22 @@ local function get_visual_selection()
|
||||
return table.concat(lines, '\n')
|
||||
end
|
||||
|
||||
local function on_stdout(id, data)
|
||||
local function on_stdout(_, data)
|
||||
for _, v in ipairs(data) do
|
||||
log.info(v)
|
||||
if #v > 0 then
|
||||
url = v
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function on_stderr(id, data)
|
||||
local function on_stderr(_, data)
|
||||
for _, v in ipairs(data) do
|
||||
log.warn(v)
|
||||
end
|
||||
end
|
||||
|
||||
local function on_exit(id, code, single)
|
||||
local function on_exit(_, code, single)
|
||||
job_id = -1
|
||||
if code == 0 and single == 0 and url ~= '' then
|
||||
vim.fn.setreg('+', url .. '.txt')
|
||||
|
Loading…
x
Reference in New Issue
Block a user