fn draw_status_bar(&self) -> Vec<u8> {
        let display_name = if self.filename.is_empty() {
            "[No name]"
        } else {
            &self.filename
        };
        let mut v: Vec<u8> = Vec::new();
        v.extend(INVERTED_COLOR);
        let lstatus = format!("{} - {} lines {}",
                              &display_name[..min(display_name.len(), 20)],
                              self.rows.len(),
                              if self.dirty { "(modified)" } else { "" });
        let rstatus = format!("{} | {}/{}",
                              self.syntax.filetype,
                              self.position.cy + 1,
                              self.rows.len());
        let truncated = &lstatus[0..min(lstatus.len(), (self.screencols - rstatus.len()))];
        v.extend(truncated.as_bytes());
        // achieve right alignment by padding with whitespace
        v.extend(std::iter::repeat(b' ').take(self.screencols - truncated.len() - rstatus.len()));
        v.extend(rstatus.as_bytes());
        v.extend(NORMAL_COLOR);
        v.extend(b"\r\n");
        v
    }
/// Return text that should be displayed in the status bar
Return text that should be displayed in the status bar
Return text that should be displayed in the status bar
fn draw_status_bar(&self) -> Vec<u8> {
        let display_name = if self.filename.is_empty() {
            "[No name]"
        } else {
            &self.filename
        };
        let mut v: Vec<u8> = Vec::new();
        v.extend(INVERTED_COLOR);
        let lstatus = format!("{} - {} lines {}",
                              &display_name[..min(display_name.len(), 20)],
                              self.rows.len(),
                              if self.dirty { "(modified)" } else { "" });
        let rstatus = format!("{} | {}/{}",
                              self.syntax.filetype,
                              self.position.cy + 1,
                              self.rows.len());
        let truncated = &lstatus[0..min(lstatus.len(), (self.screencols - rstatus.len()))];
        v.extend(truncated.as_bytes());
        // achieve right alignment by padding with whitespace
        v.extend(std::iter::repeat(b' ').take(self.screencols - truncated.len() - rstatus.len()));
        v.extend(rstatus.as_bytes());
        v.extend(NORMAL_COLOR);
        v.extend(b"\r\n");
        v
    }
fn draw_status_bar ( & self ) -> Vec < u8 > { let display_name = if self . filename . is_empty ( ) { " " } else { & self . filename } ; let mut v : Vec < u8 > = Vec :: new ( ) ; v . extend ( INVERTED_COLOR ) ; let lstatus = format ! ( " " display_name [ min ( display_name len ( ) 20 ) ] self rows len ( ) if self dirty { " " } else { " " } ) ; let rstatus = format ! ( " " self syntax filetype self position cy 1 self rows len ( ) ) ; let truncated = & lstatus [ 0 .. min ( lstatus . len ( ) , ( self . screencols - rstatus . len ( ) ) ) ] ; v . extend ( truncated . as_bytes ( ) ) ; // achieve right alignment by padding with whitespace v . extend ( std :: iter :: repeat ( b' ' ) . take ( self . screencols - truncated . len ( ) - rstatus . len ( ) ) ) ; v . extend ( rstatus . as_bytes ( ) ) ; v . extend ( NORMAL_COLOR ) ; v . extend ( b" \r \n " ) ; v }
Return text that should be displayed in the status bar
Return text that should be displayed in the status bar
&self