Skip to content
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: emit YaziRenamedOrMoved event when files are renamed or moved #495

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

mikavilpas
Copy link
Owner

Problem

When files are renamed or moved in yazi, there is no way for other plugins to know about this. If the user uses yazi.nvim along with other plugins that need to react to files being renamed or moved, it cannot be done. This means that other plugins that depend on yazi cannot react to these changes.

Currently yazi.nvim can only react to LSP delete/rename events, but plugins that operate outside of the LSP protocol are not supported.

Solution

Add a new Neovim autocmd/event called YaziRenamedOrMoved that is emitted when files are renamed or moved. This event will contain a table of the paths that were renamed or moved.

Previously we were already emitting a Neovim event for YaziDDSHover - now we have two custom events.

Closes #494

Problem
=======

When files are renamed or moved in yazi, there is no way for other
plugins to know about this. If the user uses yazi.nvim along with other
plugins that need to react to files being renamed or moved, it cannot be
done. This means that other plugins that depend on yazi cannot react to
these changes.

Currently yazi.nvim can only react to LSP delete/rename events, but
plugins that operate outside of the LSP protocol are not supported.

Solution
========

Add a new Neovim autocmd/event called `YaziRenamedOrMoved` that is
emitted when files are renamed or moved. This event will contain a table
of the paths that were renamed or moved.

Previously we were already emitting a Neovim event for `YaziDDSHover` -
now we have two custom events.

Closes #494
@mikavilpas mikavilpas enabled auto-merge (squash) October 4, 2024 16:58
@mikavilpas mikavilpas merged commit c4befd1 into main Oct 4, 2024
14 checks passed
@mikavilpas mikavilpas deleted the publish-rename-and-move-events branch October 4, 2024 16:59
This was referenced Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add customized events for operation like file renaming
1 participant