mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
21 lines
441 B
Rust
21 lines
441 B
Rust
use anyhow::Result;
|
|
use yazi_macro::{act, succ};
|
|
use yazi_parser::{VoidOpt, mgr::CdSource};
|
|
use yazi_shared::event::Data;
|
|
|
|
use crate::{Actor, Ctx};
|
|
|
|
pub struct Back;
|
|
|
|
impl Actor for Back {
|
|
type Options = VoidOpt;
|
|
|
|
const NAME: &str = "back";
|
|
|
|
fn act(cx: &mut Ctx, _: Self::Options) -> Result<Data> {
|
|
if let Some(u) = cx.tab_mut().backstack.shift_backward().cloned() {
|
|
return act!(mgr:cd, cx, (u, CdSource::Back));
|
|
}
|
|
succ!();
|
|
}
|
|
}
|