Skip to main content

yazi_widgets/input/actor/
visual.rs

1use anyhow::Result;
2use yazi_macro::{act, render, succ};
3use yazi_shared::data::Data;
4
5use crate::input::{Input, InputMode, op::InputOp};
6
7impl Input {
8	pub fn visual(&mut self, _: ()) -> Result<Data> {
9		if self.snap().mode != InputMode::Normal {
10			act!(escape, self)?;
11		}
12
13		let snap = self.snap_mut();
14		if let InputOp::Select(_) = snap.op {
15			succ!();
16		}
17
18		if !snap.value.is_empty() {
19			snap.op = InputOp::Select(snap.cursor);
20			render!();
21		}
22
23		succ!();
24	}
25}