Skip to content

Commit

Permalink
fix: correctly handle CRLF on Windows in preset archive and json
Browse files Browse the repository at this point in the history
…plugins (#2017)
  • Loading branch information
sxyazi authored Dec 9, 2024
1 parent a743488 commit 7498b97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion yazi-plugin/preset/plugins/archive.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function M.list_files(args, skip, limit)
goto continue
end

key, value = next:match("^(%u%l+) = (.+)[\r\n]+")
key, value = next:match("^(%u%l+) = (.-)[\r\n]+")
if key == "Path" then
files[#files].path = value
elseif key == "Size" then
Expand Down
7 changes: 1 addition & 6 deletions yazi-plugin/preset/plugins/json.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ local M = {}

function M:peek(job)
local child = Command("jq")
:args({
"-C",
"--tab",
".",
tostring(job.file.url),
})
:args({ "-b", "-C", "--tab", ".", tostring(job.file.url) })
:stdout(Command.PIPED)
:stderr(Command.PIPED)
:spawn()
Expand Down

0 comments on commit 7498b97

Please sign in to comment.