File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,13 @@ local function clipboard_is_img()
40
40
-- See: [Data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme)
41
41
local this_os = util .get_os ()
42
42
if this_os == util .OSType .Linux or this_os == util .OSType .FreeBSD then
43
- return vim .tbl_contains (content , " image/png" )
43
+ if vim .tbl_contains (content , " image/png" ) then
44
+ return true
45
+ elseif vim .tbl_contains (content , " text/uri-list" ) then
46
+ local success =
47
+ os.execute " wl-paste --type text/uri-list | sed 's|file://||' | head -n1 | tr -d '[:space:]' | xargs -I{} sh -c 'wl-copy < \" $1\" ' _ {}"
48
+ return success == 0
49
+ end
44
50
elseif this_os == util .OSType .Darwin then
45
51
return string.sub (content [1 ], 1 , 9 ) == " iVBORw0KG" -- Magic png number in base64
46
52
elseif this_os == util .OSType .Windows or this_os == util .OSType .Wsl then
You can’t perform that action at this time.
0 commit comments