(self, edit, update=None, index=None)
update
            True when user mean to expand, i.e. no folding for collapsed directory even if indented
        index
            list returned by self.get_all(), kinda cache during DiredExpand.expand_single_directory

        Call self.fold method on each line (multiple selections/marks), restore marks and selections
update
            True when user mean to expand, i.e. no folding for collapsed directory even if indented
        index
            list returned by self.get_all(), kinda cache during DiredExpand.expand_single_directory
update True when user mean to expand i . e . no folding for collapsed directory even if indented index list returned by self . get_all () kinda cache during DiredExpand . expand_single_directory
def run(self, edit, update=None, index=None):
        '''
        update
            True when user mean to expand, i.e. no folding for collapsed directory even if indented
        index
            list returned by self.get_all(), kinda cache during DiredExpand.expand_single_directory

        Call self.fold method on each line (multiple selections/marks), restore marks and selections
        '''
        v = self.view
        self.update = update
        self.index  = index or self.get_all()
        self.marked = None
        self.seled  = (self.get_selected(), list(self.view.sel()))
        marks       = self.view.get_regions('marked')
        virt_sels   = []

        if marks:
            for m in marks:
                if 'directory' in self.view.scope_name(m.a):
                    virt_sels.append(Region(m.a, m.a))
            self.marked = self.get_marked()
        sels = virt_sels or list(v.sel())

        lines = [v.line(s.a) for s in reversed(sels)]
        for line in lines:
            self.fold(edit, line)

        self.restore_marks(self.marked)
        self.restore_sels(self.seled)
def run ( self , edit , update = None , index = None ) : v = self . view self . update = update self . index = index or self . get_all ( ) self . marked = None self . seled = ( self . get_selected ( ) , list ( self . view . sel ( ) ) ) marks = self . view . get_regions ( 'marked' ) virt_sels = [ ] if marks : for m in marks : if 'directory' in self . view . scope_name ( m . a ) : virt_sels . append ( Region ( m . a , m . a ) ) self . marked = self . get_marked ( ) sels = virt_sels or list ( v . sel ( ) ) lines = [ v . line ( s . a ) for s in reversed ( sels ) ] for line in lines : self . fold ( edit , line ) self . restore_marks ( self . marked ) self . restore_sels ( self . seled )