mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 14:14:24 -05:00
@@ -402,17 +402,16 @@ local function imgFromClipboard()
|
||||
local png = pngdir .. "/" .. pngname
|
||||
local relpath = make_relative_path(vim.fn.expand("%:p"), png, "/")
|
||||
|
||||
local result = os.execute(get_paste_command(pngdir, pngname))
|
||||
if not result or result > 0 then
|
||||
local output = vim.fn.system(get_paste_command(pngdir, pngname))
|
||||
if output ~= "" then
|
||||
-- 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(
|
||||
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
|
||||
)
|
||||
)
|
||||
return
|
||||
end
|
||||
|
||||
if fileutils.file_exists(png) then
|
||||
|
||||
Reference in New Issue
Block a user