mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: regex
This commit is contained in:
parent
d0df31cd79
commit
fb20c1eeb6
1 changed files with 4 additions and 4 deletions
|
|
@ -14,7 +14,7 @@ function M:peek(job)
|
||||||
elseif job.skip > 0 and bound < job.skip + limit then
|
elseif job.skip > 0 and bound < job.skip + limit then
|
||||||
return ya.emit("peek", { math.max(0, bound - limit), only_if = job.file.url, upper_bound = true })
|
return ya.emit("peek", { math.max(0, bound - limit), only_if = job.file.url, upper_bound = true })
|
||||||
elseif #files == 0 then
|
elseif #files == 0 then
|
||||||
files = { { path = job.file.url.stem, size = 0, attr = "" } }
|
files = { { path = job.file.url.stem, size = 0, packed_size = 0, attr = "" } }
|
||||||
end
|
end
|
||||||
|
|
||||||
local left, right = {}, {}
|
local left, right = {}, {}
|
||||||
|
|
@ -226,7 +226,7 @@ end
|
||||||
---@return integer bound
|
---@return integer bound
|
||||||
---@return Error? err
|
---@return Error? err
|
||||||
function M.parse_7z_slt(child, skip, limit)
|
function M.parse_7z_slt(child, skip, limit)
|
||||||
local i, files, err = 0, { { path = "", size = 0, attr = "" } }, nil
|
local i, files, err = 0, { { path = "", size = 0, packed_size = 0, attr = "" } }, nil
|
||||||
local key, value, stderr = "", "", {}
|
local key, value, stderr = "", "", {}
|
||||||
repeat
|
repeat
|
||||||
local next, event = child:read_line()
|
local next, event = child:read_line()
|
||||||
|
|
@ -243,14 +243,14 @@ function M.parse_7z_slt(child, skip, limit)
|
||||||
if next == "\n" or next == "\r\n" then
|
if next == "\n" or next == "\r\n" then
|
||||||
i = i + 1
|
i = i + 1
|
||||||
if files[#files].path ~= "" then
|
if files[#files].path ~= "" then
|
||||||
files[#files + 1] = { path = "", size = 0, attr = "" }
|
files[#files + 1] = { path = "", size = 0, packed_size = 0, attr = "" }
|
||||||
end
|
end
|
||||||
goto continue
|
goto continue
|
||||||
elseif i < skip then
|
elseif i < skip then
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
|
|
||||||
key, value = next:match("^(Path|Size|Packed Size|Attributes) = (.-)[\r\n]+")
|
key, value = next:match("^(%u[%a ]+) = (.-)[\r\n]+")
|
||||||
if key == "Path" then
|
if key == "Path" then
|
||||||
files[#files].path = value
|
files[#files].path = value
|
||||||
elseif key == "Size" then
|
elseif key == "Size" then
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue