pub fn push_str(&mut self, string: impl Into<String>) {
        let string = string.into();
        if string.ends_with('\n') {
            self.lines.push_str(&string);
            self.wrap_lines.append(
                &mut self
                    .lines
                    .lines()
                    .map(|l| wrap_str(l, self.cols))
                    .collect::<Vec<Vec<String>>>(),
            );
            self.lines.clear();
        } else if string.contains('\n') {
            let mut lines = string.lines().collect::<Vec<&str>>();
            let line_count = lines.len();
            let push_lines = &mut lines[0..line_count - 1];
            self.wrap_lines.append(
                &mut push_lines
                    .iter()
                    .map(|l| wrap_str(l, self.cols))
                    .collect::<Vec<Vec<String>>>(),
            );
            self.lines.push_str(lines[line_count - 1]);
        } else {
            self.lines.push_str(&string);
        }
    }
/// Appends text to the pager output
///
/// This function will automatically split the lines, if they overflow
/// the number of terminal columns
///
/// ```
/// let mut pager = minus::Pager::new().unwrap();
/// pager.push_str("This is some text");
/// ```
Appends text to the pager output
This function will automatically split the lines, if they overflow
the number of terminal columns


Appends text to the pager output This function will automatically split the lines if they overflow the number of terminal columns
pub fn push_str(&mut self, string: impl Into<String>) {
        let string = string.into();
        if string.ends_with('\n') {
            self.lines.push_str(&string);
            self.wrap_lines.append(
                &mut self
                    .lines
                    .lines()
                    .map(|l| wrap_str(l, self.cols))
                    .collect::<Vec<Vec<String>>>(),
            );
            self.lines.clear();
        } else if string.contains('\n') {
            let mut lines = string.lines().collect::<Vec<&str>>();
            let line_count = lines.len();
            let push_lines = &mut lines[0..line_count - 1];
            self.wrap_lines.append(
                &mut push_lines
                    .iter()
                    .map(|l| wrap_str(l, self.cols))
                    .collect::<Vec<Vec<String>>>(),
            );
            self.lines.push_str(lines[line_count - 1]);
        } else {
            self.lines.push_str(&string);
        }
    }
pub fn push_str ( & mut self , string : impl Into < String > ) { let string = string . into ( ) ; if string . ends_with ( '\n' ) { self . lines . push_str ( & string ) ; self . wrap_lines . append ( & mut self . lines . lines ( ) . map ( | l | wrap_str ( l , self . cols ) ) . collect :: < Vec < Vec < String > > > ( ) , ) ; self . lines . clear ( ) ; } else if string . contains ( '\n' ) { let mut lines = string . lines ( ) . collect :: < Vec < & str > > ( ) ; let line_count = lines . len ( ) ; let push_lines = & mut lines [ 0 .. line_count - 1 ] ; self . wrap_lines . append ( & mut push_lines . iter ( ) . map ( | l | wrap_str ( l , self . cols ) ) . collect :: < Vec < Vec < String > > > ( ) , ) ; self . lines . push_str ( lines [ line_count - 1 ] ) ; } else { self . lines . push_str ( & string ) ; } }
Appends text to the pager output
This function will automatically split the lines, if they overflow
the number of terminal columns
Appends text to the pager output This function will automatically split the lines if they overflow the number of terminal columns
&mut self
string
impl Into<String>
&mut self
string
impl Into<String>