fn add_delta(&mut self, delta: Delta<RopeInfo>) {
        let head_rev_id = self.engine.get_head_rev_id();
        let undo_group;

        if self.this_edit_type == self.last_edit_type &&
            self.this_edit_type != EditType::Other &&
            !self.live_undos.is_empty() {

            undo_group = *self.live_undos.last().unwrap();
        } else {
            undo_group = self.undo_group_id;
            self.gc_undos.extend(&self.live_undos[self.cur_undo..]);
            self.live_undos.truncate(self.cur_undo);
            self.live_undos.push(undo_group);
            if self.live_undos.len() <= MAX_UNDOS {
                self.cur_undo += 1;
            } else {
                self.gc_undos.insert(self.live_undos.remove(0));
            }
            self.undo_group_id += 1;
        }
        self.last_edit_type = self.this_edit_type;
        let priority = 0x10000;
        self.engine.edit_rev(priority, undo_group, head_rev_id.token(), delta);
        self.text = self.engine.get_head().clone();
    }
/// Applies a delta to the text, and updates undo state.
///
/// Records the delta into the CRDT engine so that it can be undone. Also
/// contains the logic for merging edits into the same undo group. At call
/// time, self.this_edit_type should be set appropriately.
///
/// This method can be called multiple times, accumulating deltas that will
/// be committed at once with `commit_delta`. Note that it does not update
/// the views. Thus, view-associated state such as the selection and line
/// breaks are to be considered invalid after this method, until the
/// `commit_delta` call.
Applies a delta to the text, and updates undo state.
Records the delta into the CRDT engine so that it can be undone. Also
contains the logic for merging edits into the same undo group. At call
time, self.this_edit_type should be set appropriately.

This method can be called multiple times, accumulating deltas that will
be committed at once with `commit_delta`. Note that it does not update
the views. Thus, view-associated state such as the selection and line
breaks are to be considered invalid after this method, until the
`commit_delta` call.
Applies a delta to the text and updates undo state . Records the delta into the CRDT engine so that it can be undone . Also contains the logic for merging edits into the same undo group . At call time self . this_edit_type should be set appropriately . This method can be called multiple times accumulating deltas that will be committed at once with ` commit_delta ` . Note that it does not update the views . Thus view - associated state such as the selection and line breaks are to be considered invalid after this method until the ` commit_delta ` call .
fn add_delta(&mut self, delta: Delta<RopeInfo>) {
        let head_rev_id = self.engine.get_head_rev_id();
        let undo_group;
        if self.this_edit_type == self.last_edit_type &&
            self.this_edit_type != EditType::Other &&
            !self.live_undos.is_empty() {
            undo_group = *self.live_undos.last().unwrap();
        } else {
            undo_group = self.undo_group_id;
            self.gc_undos.extend(&self.live_undos[self.cur_undo..]);
            self.live_undos.truncate(self.cur_undo);
            self.live_undos.push(undo_group);
            if self.live_undos.len() <= MAX_UNDOS {
                self.cur_undo += 1;
            } else {
                self.gc_undos.insert(self.live_undos.remove(0));
            }
            self.undo_group_id += 1;
        }
        self.last_edit_type = self.this_edit_type;
        let priority = 0x10000;
        self.engine.edit_rev(priority, undo_group, head_rev_id.token(), delta);
        self.text = self.engine.get_head().clone();
    }
fn add_delta ( & mut self , delta : Delta < RopeInfo > ) { let head_rev_id = self . engine . get_head_rev_id ( ) ; let undo_group ; if self . this_edit_type == self . last_edit_type && self . this_edit_type != EditType :: Other && ! self . live_undos . is_empty ( ) { undo_group = * self . live_undos . last ( ) . unwrap ( ) ; } else { undo_group = self . undo_group_id ; self . gc_undos . extend ( & self . live_undos [ self . cur_undo .. ] ) ; self . live_undos . truncate ( self . cur_undo ) ; self . live_undos . push ( undo_group ) ; if self . live_undos . len ( ) <= MAX_UNDOS { self . cur_undo += 1 ; } else { self . gc_undos . insert ( self . live_undos . remove ( 0 ) ) ; } self . undo_group_id += 1 ; } self . last_edit_type = self . this_edit_type ; let priority = 0x10000 ; self . engine . edit_rev ( priority , undo_group , head_rev_id . token ( ) , delta ) ; self . text = self . engine . get_head ( ) . clone ( ) ; }
Applies a delta to the text, and updates undo state.
Applies a delta to the text and updates undo state .
&mut self
delta
Delta<RopeInfo>