Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@andrewrabert
Copy link
Contributor

Which issue does this PR resolve?

Resolves #2983

@andrewrabert andrewrabert force-pushed the always_use_bulk_rename branch 5 times, most recently from 1974740 to ec8cad8 Compare July 14, 2025 03:18
@sxyazi
Copy link
Owner

sxyazi commented Jul 14, 2025

no and yes are only introduced when a third state is needed, namely:

  • --hovered=no – false
  • --hovered=yes – true
  • --hovered – toggles between false and true

But here --hovered doesn't require three states as it's just binary (true or false), since there's no state to "toggle" to at all.

Instead, make bulk_rename a user command that always opens the editor for bulk renaming, and then you can use it with:

{ on = "R", run = "bulk_rename" }

@sxyazi sxyazi force-pushed the main branch 3 times, most recently from 9f077f9 to 60a2382 Compare July 14, 2025 15:08
@sxyazi
Copy link
Owner

sxyazi commented Jul 21, 2025

Hey @andrewrabert, are you still working on this?

@andrewrabert andrewrabert force-pushed the always_use_bulk_rename branch from ec8cad8 to 7cd287e Compare July 22, 2025 02:15
@andrewrabert
Copy link
Contributor Author

andrewrabert commented Jul 22, 2025

@sxyazi I've rebased to main with the actor model changes. Tested and confirmed it works when bound like { on = "R", run = "bulk_rename" }.

@sxyazi sxyazi changed the title Add option to always use rename with bulk editor feat: new bulk_rename command always renames files with the editor Jul 23, 2025
@sxyazi sxyazi requested a review from Copilot July 23, 2025 07:01
Copy link
Owner

@sxyazi sxyazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new bulk_rename command that always uses the editor for renaming files, resolving issue #2983. The implementation adds the command to the executor system and refactors some existing rename-related logic.

  • Added bulk_rename command to the executor dispatch system
  • Simplified error handling in plugin command execution
  • Fixed mutability issue in rename logic by changing from mutable to immutable tab access

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
yazi-fm/src/executor.rs Adds bulk_rename command to the executor dispatch system
yazi-fm/src/app/commands/plugin.rs Simplifies error handling by removing match statement and using ? operator
yazi-actor/src/mgr/rename.rs Changes tab access from mutable to immutable when checking selected items

if opt.mode.auto_then(chunk.sync_entry) != PluginMode::Sync {
succ!(self.core.tasks.plugin_micro(opt));
}

Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error handling change removes the warning log that was previously displayed when LUA runtime access failed. This could make debugging more difficult as errors will now propagate up instead of being logged and handled gracefully.

Suggested change
if let Err(e) = runtime_mut!(LUA) {
warn!("Failed to access LUA runtime: {e}");
return Err(e);
}

Copilot uses AI. Check for mistakes.
@sxyazi sxyazi merged commit 1f596a0 into sxyazi:main Jul 23, 2025
6 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to use the bulk editor for all renames

2 participants