mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
25 lines
457 B
Rust
25 lines
457 B
Rust
use anyhow::Result;
|
|
use yazi_macro::{render, succ};
|
|
use yazi_parser::mgr::LinemodeOpt;
|
|
use yazi_shared::data::Data;
|
|
|
|
use crate::{Actor, Ctx};
|
|
|
|
pub struct Linemode;
|
|
|
|
impl Actor for Linemode {
|
|
type Options = LinemodeOpt;
|
|
|
|
const NAME: &str = "linemode";
|
|
|
|
fn act(cx: &mut Ctx, opt: Self::Options) -> Result<Data> {
|
|
let tab = cx.tab_mut();
|
|
|
|
if opt.new != tab.pref.linemode {
|
|
tab.pref.linemode = opt.new.into_owned();
|
|
render!();
|
|
}
|
|
|
|
succ!();
|
|
}
|
|
}
|