Skip to content

Commit 7498b97

Browse files
authored
fix: correctly handle CRLF on Windows in preset archive and json plugins (#2017)
1 parent a743488 commit 7498b97

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

yazi-plugin/preset/plugins/archive.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function M.list_files(args, skip, limit)
110110
goto continue
111111
end
112112

113-
key, value = next:match("^(%u%l+) = (.+)[\r\n]+")
113+
key, value = next:match("^(%u%l+) = (.-)[\r\n]+")
114114
if key == "Path" then
115115
files[#files].path = value
116116
elseif key == "Size" then

yazi-plugin/preset/plugins/json.lua

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ local M = {}
22

33
function M:peek(job)
44
local child = Command("jq")
5-
:args({
6-
"-C",
7-
"--tab",
8-
".",
9-
tostring(job.file.url),
10-
})
5+
:args({ "-b", "-C", "--tab", ".", tostring(job.file.url) })
116
:stdout(Command.PIPED)
127
:stderr(Command.PIPED)
138
:spawn()

0 commit comments

Comments
 (0)