pub fn render_around_focus<W: Write>(
        &self,
        writer: &mut W,
        n: usize,
        width: usize,
    ) -> io::Result<()> {
        let y = self.tree.lines.inds[&self.tree.focused];
        let (mut start, end) = self.bounds_of_range_around_line(y, n, width);

        print!("{}", Fg(self.opts.fg_color.deref()));
        while start < end {
            let next = self.tree.lines.lines[start].next;
            let last = self.tree.lines.lines.get(next).is_none() || next >= end;

            self.render_line(writer, start, start == y, last)?;
            start = next
        }
        print!("{}", Fg(Reset));

        Ok(())
    }
/// Render at most n consecutive lines of the tree around the focused node.
///
/// Lines are considered consecutive if they are adjacent in the
/// doubly-linked list of lines in which a line's `next` and `prev`
/// fields comprise the links.
Render at most n consecutive lines of the tree around the focused node.
Lines are considered consecutive if they are adjacent in the
doubly-linked list of lines in which a line's `next` and `prev`
fields comprise the links.
Render at most n consecutive lines of the tree around the focused node . Lines are considered consecutive if they are adjacent in the doubly - linked list of lines in which a line ' s ` next ` and ` prev ` fields comprise the links .
pub fn render_around_focus<W: Write>(
        &self,
        writer: &mut W,
        n: usize,
        width: usize,
    ) -> io::Result<()> {
        let y = self.tree.lines.inds[&self.tree.focused];
        let (mut start, end) = self.bounds_of_range_around_line(y, n, width);
        print!("{}", Fg(self.opts.fg_color.deref()));
        while start < end {
            let next = self.tree.lines.lines[start].next;
            let last = self.tree.lines.lines.get(next).is_none() || next >= end;
            self.render_line(writer, start, start == y, last)?;
            start = next
        }
        print!("{}", Fg(Reset));
        Ok(())
    }
pub fn render_around_focus < W : Write > ( & self , writer : & mut W , n : usize , width : usize , ) -> io :: Result < ( ) > { let y = self . tree . lines . inds [ & self . tree . focused ] ; let ( mut start , end ) = self . bounds_of_range_around_line ( y , n , width ) ; print ! ( " " Fg ( self opts fg_color deref ( ) ) ) ; while start < end { let next = self . tree . lines . lines [ start ] . next ; let last = self . tree . lines . lines . get ( next ) . is_none ( ) || next >= end ; self . render_line ( writer , start , start == y , last ) ? ; start = next } print ! ( " " Fg ( Reset ) ) ; Ok ( ( ) ) }
Render at most n consecutive lines of the tree around the focused node.
Render at most n consecutive lines of the tree around the focused node .
&self
writer
&mut W
n
usize
width
usize
&self
writer
&mut W
n
usize
width
usize