browson/nodeview.py
def adjust_viewport(self) -> None:
        """Scroll the viewport to make sure the focused line is visible."""
        first = self.visible.first

        if self.focus < first + self.context:  # scroll viewport up
            first = self.focus - self.context
        elif self.focus > first + self.height - self.context:  # scroll down
            first = self.focus + self.context - self.height
        # Keep viewport within rendered lines
        first = max(
            0, min(len(self.lines) - 1, first + self.height) - self.height
        )

        self.visible = LineSpan(first, first + self.height)
        self.need_redraw = True
Scroll the viewport to make sure the focused line is visible.
Scroll the viewport to make sure the focused line is visible.
Scroll the viewport to make sure the focused line is visible .
def adjust_viewport(self) -> None:
        first = self.visible.first
        if self.focus < first + self.context:  
            first = self.focus - self.context
        elif self.focus > first + self.height - self.context:  
            first = self.focus + self.context - self.height
        first = max(
            0, min(len(self.lines) - 1, first + self.height) - self.height
        )
        self.visible = LineSpan(first, first + self.height)
        self.need_redraw = True
def adjust_viewport ( self ) -> None : first = self . visible . first if self . focus < first + self . context : first = self . focus - self . context elif self . focus > first + self . height - self . context : first = self . focus + self . context - self . height first = max ( 0 , min ( len ( self . lines ) - 1 , first + self . height ) - self . height ) self . visible = LineSpan ( first , first + self . height ) self . need_redraw = True
Scroll the viewport to make sure the focused line is visible.
Scroll the viewport to make sure the focused line is visible .
"""Scroll the viewport to make sure the focused line is visible.""" # scroll viewport up # scroll down # Keep viewport within rendered lines
self