Skip to content

Commit 92d17ee

Browse files
committed
refactor: pull directory traversal out into a function
1 parent c569263 commit 92d17ee

File tree

12 files changed

+601
-366
lines changed

12 files changed

+601
-366
lines changed

yazi-plugin/preset/components/tasks.lua

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ function Tasks:redraw()
6262
end
6363

6464
function Tasks:icon(snap)
65-
if snap.prog.kind == "FilePaste" then
66-
return snap.name:find("Copy ", 1, true) == 1 and "" or ""
65+
if snap.prog.kind == "FileCopy" then
66+
return ""
67+
elseif snap.prog.kind == "FileCut" then
68+
return ""
6769
elseif snap.prog.kind == "FileDelete" then
6870
return ""
6971
elseif snap.prog.kind == "FileDownload" then
@@ -77,7 +79,13 @@ end
7779

7880
function Tasks:progress_redraw(snap, y)
7981
local kind = snap.prog.kind
80-
if kind == "FilePaste" or kind == "FileDelete" or kind == "FileDownload" or kind == "FileUpload" then
82+
if
83+
kind == "FileCopy"
84+
or kind == "FileCut"
85+
or kind == "FileDelete"
86+
or kind == "FileDownload"
87+
or kind == "FileUpload"
88+
then
8189
local percent
8290
if snap.success then
8391
percent = "Cleaning…"

0 commit comments

Comments
 (0)