feat!: make backspace command not close the input even when value is empty (#1680)

This commit is contained in:
XYenon 2024-10-03 07:41:28 +08:00 committed by GitHub
parent e1773b11f1
commit a96c60ce6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 5 deletions

View file

@ -16,10 +16,6 @@ impl From<bool> for Opt {
impl Input { impl Input {
pub fn backspace(&mut self, opt: impl Into<Opt>) { pub fn backspace(&mut self, opt: impl Into<Opt>) {
let snap = self.snaps.current_mut(); let snap = self.snaps.current_mut();
if snap.value.is_empty() {
return self.close(false);
}
let opt = opt.into() as Opt; let opt = opt.into() as Opt;
if !opt.under && snap.cursor < 1 { if !opt.under && snap.cursor < 1 {
return; return;