Skip to content

Commit

Permalink
Purge debug assert and all lines making it up
Browse files Browse the repository at this point in the history
  • Loading branch information
spoutn1k committed Nov 12, 2024
1 parent 7b1043c commit c7001af
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/draw_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,22 +505,9 @@ impl DrawState {

let term_width = term.width() as usize;

// The number of text lines that are contained in this draw state
let text_line_count = self
.lines
.iter()
.filter(|line| matches!(line, LineType::Text(_) | LineType::Empty))
.count();

// Here we calculate the terminal vertical height each of those groups require when
// printing, taking wrapping into account.
let text_height = self.visual_line_count(..text_line_count, term_width);
let bar_height = self.visual_line_count(text_line_count.., term_width);
// Here we calculate the terminal vertical real estate that the state requires
let full_height = self.visual_line_count(.., term_width);

// Sanity checks
debug_assert!(full_height == text_height + bar_height);

let shift = match self.alignment {
// If we align to the bottom and the new height is less than before, clear the lines
// that are not used by the new content.
Expand Down

0 comments on commit c7001af

Please sign in to comment.