mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
24 lines
473 B
Rust
24 lines
473 B
Rust
use anyhow::Result;
|
|
use yazi_macro::{act, render, succ};
|
|
use yazi_parser::VoidForm;
|
|
use yazi_shared::data::Data;
|
|
use yazi_widgets::input::InputMode;
|
|
|
|
use crate::{Actor, Ctx};
|
|
|
|
pub struct Escape;
|
|
|
|
impl Actor for Escape {
|
|
type Form = VoidForm;
|
|
|
|
const NAME: &str = "escape";
|
|
|
|
fn act(cx: &mut Ctx, _: Self::Form) -> Result<Data> {
|
|
if cx.help.input.mode() == InputMode::Normal {
|
|
return act!(help:close, cx);
|
|
}
|
|
|
|
act!(escape, cx.help.input)?;
|
|
succ!(render!());
|
|
}
|
|
}
|