Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this change, when
ya.image_info()andya.image_show()failed, there was no way to determine the reason for the failure.With this PR, a new second return value has been added to them, in the event of a failure, it will carry an
Erroruserdata that provides the caller with the error message.All built-in image previewers in Yazi have been updated to support this, that is, when an image preview fails, the error will be displayed in the preview pane so that the user knows what went wrong.
Deprecated API
ya.preview_widgets()has been deprecated and replaced by the newya.preview_widget():In addition to supporting the table parameter as the original
ya.preview_widgets()did, the newya.preview_widget()can also accept a single renderable element directly without the need to wrap it in a table:Considering that
ya.preview_widgets()has been widely used in previewers, it will continue to be available for a long time. Deprecation warnings will be added later, and it will eventually be removed.