mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
@@ -402,17 +402,16 @@ local function imgFromClipboard()
|
|||||||
local png = pngdir .. "/" .. pngname
|
local png = pngdir .. "/" .. pngname
|
||||||
local relpath = make_relative_path(vim.fn.expand("%:p"), png, "/")
|
local relpath = make_relative_path(vim.fn.expand("%:p"), png, "/")
|
||||||
|
|
||||||
local result = os.execute(get_paste_command(pngdir, pngname))
|
local output = vim.fn.system(get_paste_command(pngdir, pngname))
|
||||||
if not result or result > 0 then
|
if output ~= "" then
|
||||||
-- Remove empty file created by previous command if failed
|
-- Remove empty file created by previous command if failed
|
||||||
os.execute("rm " .. pngdir .. "/" .. pngname)
|
vim.fn.system("rm " .. pngdir .. "/" .. pngname)
|
||||||
vim.api.nvim_err_writeln(
|
vim.api.nvim_err_writeln(
|
||||||
string.format(
|
string.format(
|
||||||
"Unable to write image %s. Is there an image on the clipboard? See also issue 131",
|
"Unable to write image %s.\nIs there an image on the clipboard?\nSee also issue 131",
|
||||||
png
|
png
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if fileutils.file_exists(png) then
|
if fileutils.file_exists(png) then
|
||||||
|
|||||||
Reference in New Issue
Block a user