fn print(
        &self,
        line_format: &LineFormat,
        search_body: bool
    ) -> Result<(), ThecaError> {
        let column_seperator: String = repeat(' ').take(line_format.colsep)
                                                  .collect();
        print!("{}", format_field(
            &self.id.to_string(),
            line_format.id_width,
            false
        ));
        print!("{}", column_seperator);
        match !self.body.is_empty() && !search_body {
            true => {
                print!("{}", format_field(
                    &self.title,
                    line_format.title_width-4,
                    true
                ));
                print!("{}", format_field(&" (+)".to_string(), 4, false));
            },
            false => {
                print!("{}", format_field(
                    &self.title,
                    line_format.title_width,
                    true
                ));
            }
        }
        print!("{}", column_seperator);
        if line_format.status_width != 0 {
            print!("{}", format_field(
                &self.status,
                line_format.status_width,
                false
            ));
            print!("{}", column_seperator);
        }
        print!("{}", format_field(
            &try!(localize_last_touched_string(&*self.last_touched)),
            line_format.touched_width,
            false
        ));
        print!("\n");
        if search_body {
            for l in self.body.lines() {
                println!("\t{}", l);
            }
        }
        Ok(())
    }
/// print a note as a line
print a note as a line
print a note as a line
fn print(
        &self,
        line_format: &LineFormat,
        search_body: bool
    ) -> Result<(), ThecaError> {
        let column_seperator: String = repeat(' ').take(line_format.colsep)
                                                  .collect();
        print!("{}", format_field(
            &self.id.to_string(),
            line_format.id_width,
            false
        ));
        print!("{}", column_seperator);
        match !self.body.is_empty() && !search_body {
            true => {
                print!("{}", format_field(
                    &self.title,
                    line_format.title_width-4,
                    true
                ));
                print!("{}", format_field(&" (+)".to_string(), 4, false));
            },
            false => {
                print!("{}", format_field(
                    &self.title,
                    line_format.title_width,
                    true
                ));
            }
        }
        print!("{}", column_seperator);
        if line_format.status_width != 0 {
            print!("{}", format_field(
                &self.status,
                line_format.status_width,
                false
            ));
            print!("{}", column_seperator);
        }
        print!("{}", format_field(
            &try!(localize_last_touched_string(&*self.last_touched)),
            line_format.touched_width,
            false
        ));
        print!("\n");
        if search_body {
            for l in self.body.lines() {
                println!("\t{}", l);
            }
        }
        Ok(())
    }
fn print ( & self , line_format : & LineFormat , search_body : bool ) -> Result < ( ) , ThecaError > { let column_seperator : String = repeat ( ' ' ) . take ( line_format . colsep ) . collect ( ) ; print ! ( " " format_field ( self id to_string ( ) line_format id_width false ) ) ; print ! ( " " column_seperator ) ; match ! self . body . is_empty ( ) && ! search_body { true => { print ! ( " " format_field ( self title line_format title_width 4 true ) ) ; print ! ( " " format_field ( " " to_string ( ) 4 false ) ) ; } , false => { print ! ( " " format_field ( self title line_format title_width true ) ) ; } } print ! ( " " column_seperator ) ; if line_format . status_width != 0 { print ! ( " " format_field ( self status line_format status_width false ) ) ; print ! ( " " column_seperator ) ; } print ! ( " " format_field ( try ( localize_last_touched_string ( self last_touched ) ) line_format touched_width false ) ) ; print ! ( " \n " ) ; if search_body { for l in self . body . lines ( ) { println ! ( " \t " l ) ; } } Ok ( ( ) ) }
print a note as a line
print a note as a line
&self
line_format
&LineFormat
search_body
bool
&self
line_format
&LineFormat
search_body
bool