(self, edit, path, names, expanded, to_expand, toggle)
Called when we know that some directories were (or/and need to be) expanded
Called when we know that some directories were (or/and need to be) expanded
Called when we know that some directories were ( or / and need to be ) expanded
def re_populate_view(self, edit, path, names, expanded, to_expand, toggle):
        '''Called when we know that some directories were (or/and need to be) expanded'''
        root = path
        for i, r in enumerate(expanded):
            name = self.get_fullpath_for(r)
            expanded[i] = name
        if toggle and to_expand:
            merged = list(set(expanded + to_expand))
            expanded = [e for e in merged if not (e in expanded and e in to_expand)]
        else:
            expanded.extend(to_expand or [])
        self.expanded = expanded
        # we need prev index to setup expanded list — done, so reset index
        self.index = []

        tree = self.traverse_tree(root, root, '', names, expanded)
        if not tree:
            return self.populate_view(edit, path, names)

        self.set_status()
        items = self.correcting_index(path, tree)
        self.write(edit, items)
        self.restore_selections(path)
        self.view.run_command('dired_call_vcs', {'path': path})
def re_populate_view ( self , edit , path , names , expanded , to_expand , toggle ) : root = path for i , r in enumerate ( expanded ) : name = self . get_fullpath_for ( r ) expanded [ i ] = name if toggle and to_expand : merged = list ( set ( expanded + to_expand ) ) expanded = [ e for e in merged if not ( e in expanded and e in to_expand ) ] else : expanded . extend ( to_expand or [ ] ) self . expanded = expanded # we need prev index to setup expanded list — done, so reset index self . index = [ ] tree = self . traverse_tree ( root , root , '' , names , expanded ) if not tree : return self . populate_view ( edit , path , names ) self . set_status ( ) items = self . correcting_index ( path , tree ) self . write ( edit , items ) self . restore_selections ( path ) self . view . run_command ( 'dired_call_vcs' , { 'path' : path } )