fn grow_lines(&mut self, growage: usize, template_row: Row<T>)
    where
        T: Clone,
    {
        // Only grow if there are not enough lines still hidden
        let mut new_growage = 0;
        if growage > (self.inner.len() - self.len) {
            // Lines to grow additionally to invisible lines
            new_growage = growage - (self.inner.len() - self.len);

            // Split off the beginning of the raw inner buffer
            let mut start_buffer = self.inner.split_off(self.zero);

            // Insert new template rows at the end of the raw inner buffer
            let mut new_lines = vec![template_row; new_growage];
            self.inner.append(&mut new_lines);

            // Add the start to the raw inner buffer again
            self.inner.append(&mut start_buffer);
        }

        // Update raw buffer length and zero offset
        self.zero = (self.zero + new_growage) % self.inner.len();
        self.len += growage;
    }
/// Grow the number of lines in the buffer, filling new lines with the template
Grow the number of lines in the buffer, filling new lines with the template
Grow the number of lines in the buffer filling new lines with the template
fn grow_lines(&mut self, growage: usize, template_row: Row<T>)
    where
        T: Clone,
    {
        // Only grow if there are not enough lines still hidden
        let mut new_growage = 0;
        if growage > (self.inner.len() - self.len) {
            // Lines to grow additionally to invisible lines
            new_growage = growage - (self.inner.len() - self.len);
            // Split off the beginning of the raw inner buffer
            let mut start_buffer = self.inner.split_off(self.zero);
            // Insert new template rows at the end of the raw inner buffer
            let mut new_lines = vec![template_row; new_growage];
            self.inner.append(&mut new_lines);
            // Add the start to the raw inner buffer again
            self.inner.append(&mut start_buffer);
        }
        // Update raw buffer length and zero offset
        self.zero = (self.zero + new_growage) % self.inner.len();
        self.len += growage;
    }
fn grow_lines ( & mut self , growage : usize , template_row : Row < T > ) where T : Clone , { // Only grow if there are not enough lines still hidden let mut new_growage = 0 ; if growage > ( self . inner . len ( ) - self . len ) { // Lines to grow additionally to invisible lines new_growage = growage - ( self . inner . len ( ) - self . len ) ; // Split off the beginning of the raw inner buffer let mut start_buffer = self . inner . split_off ( self . zero ) ; // Insert new template rows at the end of the raw inner buffer let mut new_lines = vec ! [ template_row new_growage ] ; self . inner . append ( & mut new_lines ) ; // Add the start to the raw inner buffer again self . inner . append ( & mut start_buffer ) ; } // Update raw buffer length and zero offset self . zero = ( self . zero + new_growage ) % self . inner . len ( ) ; self . len += growage ; }
Grow the number of lines in the buffer, filling new lines with the template
Grow the number of lines in the buffer filling new lines with the template
&mut self
growage
usize
template_row
Row<T>
&mut self
growage
usize
template_row
Row<T>