edit the correct column

This commit is contained in:
🪞👃🪞 2025-03-22 20:50:55 +02:00
parent ac8e3dd198
commit c3fbc6abf1
2 changed files with 40 additions and 29 deletions

View file

@ -86,15 +86,15 @@ impl Taggart {
self.editing = None;
}
pub fn edit_insert (&mut self, c: char) {
if let Some((index, value)) = &mut self.editing {
self.editing = Some((*index, format!("{value}{c}")));
if let Some((edit_index, value)) = &mut self.editing {
self.editing = Some((*edit_index, format!("{value}{c}")));
}
}
pub fn edit_backspace (&mut self) {
if let Some((index, value)) = &mut self.editing {
if let Some((edit_index, value)) = &mut self.editing {
let mut chars = value.chars();
chars.next_back();
self.editing = Some((*index, chars.as_str().into()));
self.editing = Some((*edit_index, chars.as_str().into()));
}
}
pub fn edit_delete (&mut self) {