fix(tabs): delete characters when renaming tab (#226)

This commit is contained in:
Jonah Caplan 2021-03-15 05:52:50 -04:00 committed by GitHub
parent dbbafae606
commit a174989990
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -100,6 +100,9 @@ impl ZellijTile for State {
self.new_name.clear();
}
Key::Char(c) => self.new_name = format!("{}{}", self.new_name, c),
Key::Backspace | Key::Delete => {
self.new_name.pop();
}
_ => {}
}
}

View File

@ -294,6 +294,10 @@ impl Screen {
self.update_tabs();
self.render();
}
"\u{007F}" | "\u{0008}" => {
//delete and backspace keys
self.tabname_buf.pop();
}
c => {
self.tabname_buf.push_str(c);
}