yazi_core/spot/commands/
close.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use yazi_macro::render;
use yazi_shared::event::CmdCow;

use crate::spot::Spot;

struct Opt;

impl From<CmdCow> for Opt {
	fn from(_: CmdCow) -> Self { Self }
}
impl From<()> for Opt {
	fn from(_: ()) -> Self { Self }
}

impl Spot {
	#[yazi_codegen::command]
	pub fn close(&mut self, _: Opt) {
		self.abort();
		render!(self.lock.take().is_some());
	}
}