Skip to content

Commit aef08df

Browse files
committed
fix: adapt to new yazi arrow command for pane navigation
Yazi's API has changed, requiring the use of the "arrow top" and "arrow bottom" commands to jump to the top or bottom of the current pane. See the related change here: sxyazi/yazi#2294. This commit updates the plugin to use the new commands, preventing the popup from appearing when navigating panes in newer Yazi versions. :) fix: wrong keyword
1 parent acdcf11 commit aef08df

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ local get_cache_or_first_dir = ya.sync(function(state)
220220
elseif state._enter_mode == ENTER_MODE_CACHE_OR_FIRST then
221221
local hovered_file = cx.active.current.hovered
222222

223-
if hovered_file ~= nil and hovered_file.cha.is_dir then
223+
if hovered_file ~= nil and hovered_file.cha.is_dir then
224224
return cx.active.current.cursor
225225
end
226226
end
@@ -263,7 +263,7 @@ return {
263263

264264
if cmd == "g" then
265265
if direction == "g" then
266-
ya.manager_emit("arrow", { -99999999 })
266+
ya.manager_emit("arrow", { "top" })
267267
ya.manager_emit("arrow", { lines - 1 })
268268
render_clear()
269269
return
@@ -295,7 +295,7 @@ return {
295295
ya.manager_emit("enter", {})
296296
local file_idx = get_cache_or_first_dir()
297297
if file_idx then
298-
ya.manager_emit("arrow", { -99999999 })
298+
ya.manager_emit("arrow", { "top" })
299299
ya.manager_emit("arrow", { file_idx })
300300
end
301301
end

0 commit comments

Comments
 (0)