mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
feat: close input window on backspace command if input it empty
This commit is contained in:
parent
aeb43fe00c
commit
f3a5f9ffaa
1 changed files with 7 additions and 0 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue