/// Compute the column offset at which descriptions can start.
///
/// The way we compute this is by summing all the display width and adding the require padding.
Compute the column offset at which descriptions can start.
The way we compute this is by summing all the display width and adding the require padding.
Compute the column offset at which descriptions can start . The way we compute this is by summing all the display width and adding the require padding .
fn guess_description_col_offset(&self, config: &Config) -> usize {
    let spent_width;
    let prio_width;
    let project_width;
    if config.display_empty_cols() {
      spent_width = self.spent_width + 1;
      prio_width = config.prio_col_name().width() + 1;
      project_width = self.project_width + 1;
    } else {
      // compute spent time if any
      if self.has_spent_time {
        spent_width = self.spent_width + 1;
      } else {
        spent_width = 0;
      }
      // compute priority width if any
      if self.has_priorities {
        prio_width = config.prio_col_name().width() + 1;
      } else {
        prio_width = 0;
      }
      // compute project width if any
      if self.has_projects {
        project_width = self.project_width + 1; // FIXME
      } else {
        project_width = 0;
      }
    }
    // The “+ 1” are there because of the blank spaces we have in the output to separate columns.
    1 + self.task_uid_width
      + 1
      + self.age_width
      + 1
      + spent_width
      + prio_width
      + project_width
      + self.status_width
      + 1 // to end up on the first column in the description
  }
fn guess_description_col_offset ( & self , config : & Config ) -> usize { let spent_width ; let prio_width ; let project_width ; if config . display_empty_cols ( ) { spent_width = self . spent_width + 1 ; prio_width = config . prio_col_name ( ) . width ( ) + 1 ; project_width = self . project_width + 1 ; } else { // compute spent time if any if self . has_spent_time { spent_width = self . spent_width + 1 ; } else { spent_width = 0 ; } // compute priority width if any if self . has_priorities { prio_width = config . prio_col_name ( ) . width ( ) + 1 ; } else { prio_width = 0 ; } // compute project width if any if self . has_projects { project_width = self . project_width + 1 ; // FIXME } else { project_width = 0 ; } } // The “+ 1” are there because of the blank spaces we have in the output to separate columns. 1 + self . task_uid_width + 1 + self . age_width + 1 + spent_width + prio_width + project_width + self . status_width + 1 // to end up on the first column in the description }
Compute the column offset at which descriptions can start.
Compute the column offset at which descriptions can start .
&self
config
&Config