browson/nodeview.py
def collapse_other(self) -> None:
        """Collapse all nodes not on the path to the current node.

        Do not affect the children of the current node.
        Put focus on (the first line of) the current node.
        """
        current = self.lines[self.focus].node
        path = list(current.ancestors(include_self=True))
        for node in self.root.dfwalk():
            if current in list(node.ancestors()):
                continue  # don't affect children
            if node not in path:
                node.collapsed = True  # collapse unrelated nodes

        self.rerender(0)  # redraw everything

        # Re-focus current node
        for i, (_, n) in enumerate(self.lines):
            if n is current:
                self.set_focus(i)
                break
Collapse all nodes not on the path to the current node.

        Do not affect the children of the current node.
        Put focus on (the first line of) the current node.
        
Collapse all nodes not on the path to the current node.
Do not affect the children of the current node.
Put focus on (the first line of) the current node.
Collapse all nodes not on the path to the current node . Do not affect the children of the current node . Put focus on ( the first line of ) the current node .
def collapse_other(self) -> None:
        current = self.lines[self.focus].node
        path = list(current.ancestors(include_self=True))
        for node in self.root.dfwalk():
            if current in list(node.ancestors()):
                continue  
            if node not in path:
                node.collapsed = True  
        self.rerender(0)  
        for i, (_, n) in enumerate(self.lines):
            if n is current:
                self.set_focus(i)
                break
def collapse_other ( self ) -> None : current = self . lines [ self . focus ] . node path = list ( current . ancestors ( include_self = True ) ) for node in self . root . dfwalk ( ) : if current in list ( node . ancestors ( ) ) : continue if node not in path : node . collapsed = True self . rerender ( 0 ) for i , ( _ , n ) in enumerate ( self . lines ) : if n is current : self . set_focus ( i ) break
Collapse all nodes not on the path to the current node.
Collapse all nodes not on the path to the current node .
"""Collapse all nodes not on the path to the current node.

        Do not affect the children of the current node.
        Put focus on (the first line of) the current node.
        """ # don't affect children # collapse unrelated nodes # redraw everything # Re-focus current node
self