refactor: update for Yazi v25.2.26

This commit is contained in:
sxyazi
2025-03-02 22:34:26 +08:00
parent 5186af7984
commit 3d0c7c6be9
11 changed files with 31 additions and 31 deletions

View File

@@ -1,4 +1,4 @@
--- @since 25.2.7
--- @since 25.2.26
local hovered = ya.sync(function()
local h = cx.active.current.hovered
@@ -28,20 +28,20 @@ local function entry()
while true do
local value, event = input:recv()
if event ~= 1 and event ~= 3 then
ya.manager_emit("escape", { filter = true })
ya.mgr_emit("escape", { filter = true })
break
end
ya.manager_emit("filter_do", { value, smart = true })
ya.mgr_emit("filter_do", { value, smart = true })
local h = hovered()
if h.unique and h.is_dir then
ya.manager_emit("escape", { filter = true })
ya.manager_emit("enter", {})
ya.mgr_emit("escape", { filter = true })
ya.mgr_emit("enter", {})
input = prompt()
elseif event == 1 then
ya.manager_emit("escape", { filter = true })
ya.manager_emit(h.is_dir and "enter" or "open", { h.url })
ya.mgr_emit("escape", { filter = true })
ya.mgr_emit(h.is_dir and "enter" or "open", { h.url })
end
end
end