/// Switch the current buffer to the specified buffer
Switch the current buffer to the specified buffer
Switch the current buffer to the specified buffer
pub fn switch_to(&mut self, n: usize) {
        debug_assert!(n < self.buffers.len(), "Buffer index out of bounds");
        // if the current view is transient, delete it
        let mut n = n;
        if self.current_buffer_info().is_transient {
            let index = self.current_buffer_index;
            self.delete_buffer(index);
            // if the current view is less than the view to switch to
            // then we need to account for the view we just removed
            if index <= n {
                n -= 1;
            }
        }
        self.current_buffer_index = n;
    }
pub fn switch_to ( & mut self , n : usize ) { debug_assert ! ( n self buffers len ( ) " " ) ; // if the current view is transient, delete it let mut n = n ; if self . current_buffer_info ( ) . is_transient { let index = self . current_buffer_index ; self . delete_buffer ( index ) ; // if the current view is less than the view to switch to // then we need to account for the view we just removed if index <= n { n -= 1 ; } } self . current_buffer_index = n ; }
Switch the current buffer to the specified buffer
Switch the current buffer to the specified buffer
&mut self
n
usize