feat: close input window on backspace command if input it empty

This commit is contained in:
rolv 2024-02-05 15:26:47 +00:00
parent aeb43fe00c
commit f3a5f9ffaa

View file

@ -18,6 +18,13 @@ impl Input {
let opt = opt.into() as Opt;
let snap = self.snaps.current_mut();
if snap.value.is_empty() {
self.ticket = self.ticket.wrapping_add(1);
self.visible = false;
render!();
return;
}
if !opt.under && snap.cursor < 1 {
return;
} else if opt.under && snap.cursor >= snap.value.len() {