Fix: revert optimizations

This commit is contained in:
2026-02-23 00:51:01 +01:00
parent f47285385c
commit 009d68087d
20 changed files with 134 additions and 377 deletions

View File

@@ -147,26 +147,23 @@ pub(super) fn handle_main_page(ctx: &mut InputContext, key: KeyEvent, ctrl: bool
}
}
KeyCode::Char('r') if ctrl => {
let script = ctx
.app
.current_edit_pattern()
.resolve_script(ctx.app.editor_ctx.step)
.filter(|s| !s.trim().is_empty())
.map(|s| s.to_owned());
if let Some(script) = script {
match ctx
.app
.execute_script_oneshot(&script, ctx.link, ctx.audio_tx)
{
Ok(()) => ctx
let pattern = ctx.app.current_edit_pattern();
if let Some(script) = pattern.resolve_script(ctx.app.editor_ctx.step) {
if !script.trim().is_empty() {
match ctx
.app
.ui
.flash("Executed", 100, crate::state::FlashKind::Info),
Err(e) => ctx.app.ui.flash(
&format!("Error: {e}"),
200,
crate::state::FlashKind::Error,
),
.execute_script_oneshot(script, ctx.link, ctx.audio_tx)
{
Ok(()) => ctx
.app
.ui
.flash("Executed", 100, crate::state::FlashKind::Info),
Err(e) => ctx.app.ui.flash(
&format!("Error: {e}"),
200,
crate::state::FlashKind::Error,
),
}
}
}
}