Skip to content

Commit

Permalink
Don't cause cursor movement when using '0' as MoveUp value
Browse files Browse the repository at this point in the history
One might argue that should be a noop
  • Loading branch information
Byron committed Jul 10, 2020
1 parent 443702b commit d090c0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/line/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ pub fn all(
crosstermion::execute!(out, crosstermion::cursor::MoveUp(state.blocks_per_line.len() as u16))?;
state.blocks_per_line.resize(lines_drawn, 0);
} else {
crosstermion::execute!(out, crosstermion::cursor::MoveUp(lines_drawn as u16))?;
if lines_drawn > 0 {
crosstermion::execute!(out, crosstermion::cursor::MoveUp(lines_drawn as u16))?;
}
}
}
Ok(())
Expand Down

0 comments on commit d090c0c

Please sign in to comment.