pub fn redo(&mut self, steps: usize) -> EditResult<Node::Class> {
        log::trace!("Performing redo.");
        // Early return if there are no changes to redo
        if self.history_index >= self.root_history.len() - 1 {
            return Err(EditErr::NoChangesToRedo);
        }
        // Move the history index forward by one to perform the redo
        self.history_index = (self.history_index + steps).min(self.root_history.len() - 1);
        // Follow the behaviour of other text editors and update the location of the cursor
        // with its location in the snapshot we are going back to
        self.current_cursor_path
            .clone_from(&self.root_history[self.history_index].cursor_after);
        log::debug!("Setting cursor path to {:?}", self.current_cursor_path);
        Ok(EditSuccess::Redo)
    }
/// Move one step forward in the tree history
Move one step forward in the tree history
Move one step forward in the tree history
pub fn redo(&mut self, steps: usize) -> EditResult<Node::Class> {
        log::trace!("Performing redo.");
        // Early return if there are no changes to redo
        if self.history_index >= self.root_history.len() - 1 {
            return Err(EditErr::NoChangesToRedo);
        }
        // Move the history index forward by one to perform the redo
        self.history_index = (self.history_index + steps).min(self.root_history.len() - 1);
        // Follow the behaviour of other text editors and update the location of the cursor
        // with its location in the snapshot we are going back to
        self.current_cursor_path
            .clone_from(&self.root_history[self.history_index].cursor_after);
        log::debug!("Setting cursor path to {:?}", self.current_cursor_path);
        Ok(EditSuccess::Redo)
    }
pub fn redo ( & mut self , steps : usize ) -> EditResult < Node :: Class > { log :: trace ! ( " " ) ; // Early return if there are no changes to redo if self . history_index >= self . root_history . len ( ) - 1 { return Err ( EditErr :: NoChangesToRedo ) ; } // Move the history index forward by one to perform the redo self . history_index = ( self . history_index + steps ) . min ( self . root_history . len ( ) - 1 ) ; // Follow the behaviour of other text editors and update the location of the cursor // with its location in the snapshot we are going back to self . current_cursor_path . clone_from ( & self . root_history [ self . history_index ] . cursor_after ) ; log :: debug ! ( " " self current_cursor_path ) ; Ok ( EditSuccess :: Redo ) }
Move one step forward in the tree history
Move one step forward in the tree history
&mut self
steps
usize
&mut self
steps
usize