yazi_core/input/commands/
undo.rs

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

use crate::input::{Input, InputMode};

impl Input {
	pub fn undo(&mut self, _: CmdCow) {
		if !self.snaps.undo() {
			return;
		}
		if self.snap().mode == InputMode::Insert {
			self.escape(());
		}
		render!();
	}
}