feat: support reacting to custom yazi DDS events #570
Merged
+148
−8
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.
Issue
Yazi is incredibly versatile and can be used for many different things.
However, it's too difficult to predict what the needs of every user will
be. Power users have no easy way to extend the behaviour of yazi.nvim
beyond the features that are built-in.
Solution
Allow users to subscribe to custom yazi DDS events. These events are
possibly not included in yazi by default, but can be published by yazi
plugins or by other applications using yazi's DDS system.
By default, all custom events are ignored. The user can specify which
events they want to listen to by setting a new
forwarded_dds_events
(string[], default nil) config option.
When an event whose kind is included in this
forwarded_dds_events
listis received, yazi.nvim will emit a neovim autocmd event with the name
YaziDDSCustom
. The event will contain thetype
of the event and theraw_data
as a string. The user can then set up custom handlers forthese events in their neovim config.
Solves #547