update: exit input instaed of change mode for empty input

This commit is contained in:
Yiang 2024-11-27 06:41:55 +08:00
parent 5e48df5126
commit 4c5778f2c2

View file

@ -25,6 +25,11 @@ impl Input {
snap.op = InputOp::None; snap.op = InputOp::None;
} }
InputMode::Insert => { InputMode::Insert => {
if snap.value.trim().is_empty() {
self.close(false);
return;
}
snap.mode = InputMode::Normal; snap.mode = InputMode::Normal;
self.move_(-1); self.move_(-1);