Skip to content

Commit

Permalink
fix: do not unset the block on render
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo committed Nov 6, 2022
1 parent a902bce commit 9821255
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,11 @@ impl<'a> StatefulWidget for Tree<'a> {
type State = TreeState;

#[allow(clippy::too_many_lines)]
fn render(mut self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
buf.set_style(area, self.style);

// Get the inner area inside a possible block, otherwise use the full area
let area = self.block.take().map_or(area, |b| {
let area = self.block.map_or(area, |b| {
let inner_area = b.inner(area);
b.render(area, buf);
inner_area
Expand Down

0 comments on commit 9821255

Please sign in to comment.