-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: support passing arguments to previewer/preloader/spotter/fetcher #1966
Merged
631
−438
Conversation
This file contains 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
sxyazi
commented
Nov 29, 2024
sxyazi
added a commit
to yazi-rs/plugins
that referenced
this pull request
Nov 29, 2024
sxyazi
added a commit
that referenced
this pull request
Nov 29, 2024
sxyazi
added a commit
that referenced
this pull request
Nov 29, 2024
TornaxO7
added a commit
to TornaxO7/bookmarks.yazi
that referenced
this pull request
Nov 29, 2024
boydaihungst
added a commit
to boydaihungst/mediainfo.yazi
that referenced
this pull request
Nov 29, 2024
zooeywm
added a commit
to zooeywm/sudo.yazi
that referenced
this pull request
Nov 30, 2024
TD-Sky
pushed a commit
to TD-Sky/sudo.yazi
that referenced
this pull request
Nov 30, 2024
…for `assets` * `ya pack` -a support assets folder contains miscellaneous files * sxyazi/yazi#1966
GrzegorzKozub
added a commit
to GrzegorzKozub/mdcat.yazi
that referenced
this pull request
Nov 30, 2024
sxyazi
added a commit
that referenced
this pull request
Nov 30, 2024
mikavilpas
added a commit
to mikavilpas/starship.yazi
that referenced
this pull request
Nov 30, 2024
Issue ===== The nightly version of yazi has changed the way arguments are passed to the plugin entry point. Previously they were a table that contained the arguments, but they were moved inside {args = {...}}. If the user is using a nightly version of yazi, they will see a deprecation warning. sxyazi/yazi#1966 Solution ======== This change removes the warning and supports both versions.
Rolv-Apneseth
pushed a commit
to Rolv-Apneseth/starship.yazi
that referenced
this pull request
Nov 30, 2024
Issue ===== The nightly version of yazi has changed the way arguments are passed to the plugin entry point. Previously they were a table that contained the arguments, but they were moved inside {args = {...}}. If the user is using a nightly version of yazi, they will see a deprecation warning. sxyazi/yazi#1966 Solution ======== This change removes the warning and supports both versions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds the ability to pass parameters to the previewer/preloader/spotter/fetcher. For example, you can pass parameters to your previewer in
yazi.toml
like this:Then, the first parameter
job
in thepeek()
method of themy-plugin
plugin will receive it:Which logs:
Similarly, preloader/spotter/fetcher also support parameter passing:
Then, their respective
preload()
,spot()
, andfetch()
methods will receive thejob.args
:1. Task information for
peek()
/seek()
/preload()
has been moved fromself
to thejob
parameter.Before:
Now:
These properties can still be accessed via
self
, but a deprecation warning will be shown. This compatibility layer will be fully removed in Yazi 0.4.2.The change aims to resolve potential conflicts between Yazi’s internal properties and user plugin properties.
2. The first parameter of
entry()
has been replaced with the newjob
parameter.Before:
Now:
The new
job
can still be used just like the originalargs
(likejob[1]
oripairs(job)
), but a deprecation warning will be shown. This compatibility layer will be fully removed in Yazi 0.4.2.3. The first parameter of
seek()
has been changed from a numberunits
to a tablejob
.Before:
Now:
This change is made to provide extensibility for adding more fields in the future.