Skip to content
Discussion options

You must be logged in to vote

local time = (cx.active.current.hovered.cha.mtime or 0) // 1

The type of cx.active.current.hovered is File?, which means it may be nil

If there's no file within the folder at all, then there's also no hovered file, so you need to check if it's nil:

if not cx.active.current.hovered then
  return ui.Line {}
end

I'd recommend using the types.yazi which is a type definition of Yazi APIs to avoid all such errors - LSP is your friend!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by og900aero
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
1. Q&A
Labels
None yet
2 participants