fn delete_char(&mut self) {
        if self.position.cy == self.rows.len() || (self.position.cx == 0 && self.position.cy == 0) {
            return;
        }
        if self.position.cx > 0 {
            let row = &mut self.rows[self.position.cy];
            row.delete_char(self.position.cx - 1);
            self.position.cx -= 1;
        } else {
            let row = self.rows.remove(self.position.cy);
            let prev = &mut self.rows[self.position.cy - 1];
            self.position.cx = prev.len;
            prev.push(&row);
            self.position.cy -= 1;

        }
        self.dirty = true;
    }
/// delete a char at the current position
delete a char at the current position
delete a char at the current position
fn delete_char(&mut self) {
        if self.position.cy == self.rows.len() || (self.position.cx == 0 && self.position.cy == 0) {
            return;
        }
        if self.position.cx > 0 {
            let row = &mut self.rows[self.position.cy];
            row.delete_char(self.position.cx - 1);
            self.position.cx -= 1;
        } else {
            let row = self.rows.remove(self.position.cy);
            let prev = &mut self.rows[self.position.cy - 1];
            self.position.cx = prev.len;
            prev.push(&row);
            self.position.cy -= 1;
        }
        self.dirty = true;
    }
fn delete_char ( & mut self ) { if self . position . cy == self . rows . len ( ) || ( self . position . cx == 0 && self . position . cy == 0 ) { return ; } if self . position . cx > 0 { let row = & mut self . rows [ self . position . cy ] ; row . delete_char ( self . position . cx - 1 ) ; self . position . cx -= 1 ; } else { let row = self . rows . remove ( self . position . cy ) ; let prev = & mut self . rows [ self . position . cy - 1 ] ; self . position . cx = prev . len ; prev . push ( & row ) ; self . position . cy -= 1 ; } self . dirty = true ; }
delete a char at the current position
delete a char at the current position
&mut self