(self, sels=None)
return self._add_sels()
sels is tuple of two elements:
            0 list of filenames
                relative paths to search in the view
            1 list of Regions
                copy of view.sel(), used for fallback if filenames are not found
                in view (e.g. user deleted selected file)
sels is tuple of two elements:
            0 list of filenames
                relative paths to search in the view
            1 list of Regions
                copy of view.sel(), used for fallback if filenames are not found
                in view (e.g. user deleted selected file)
sels is tuple of two elements : 0 list of filenames relative paths to search in the view 1 list of Regions copy of view . sel () used for fallback if filenames are not found in view ( e . g . user deleted selected file )
def restore_sels(self, sels=None):
        '''
        sels is tuple of two elements:
            0 list of filenames
                relative paths to search in the view
            1 list of Regions
                copy of view.sel(), used for fallback if filenames are not found
                in view (e.g. user deleted selected file)
        '''
        if sels:
            seled_fnames, seled_regions = sels
            path = self.get_path()
            regions = []
            for selection in seled_fnames:
                matches = self._find_in_view(selection)
                for region in matches:
                    filename = self.get_parent(region, path)
                    if filename == selection:
                        name_point = self._get_name_point(region)
                        regions.append(Region(name_point, name_point))
                        break
            if regions:
                return self._add_sels(regions)
            else:
                # e.g. when user remove file(s), we just restore sel RegionSet
                # despite positions may be wrong sometimes
                return self._add_sels(seled_regions)
        # fallback:
        return self._add_sels()
def restore_sels ( self , sels = None ) : if sels : seled_fnames , seled_regions = sels path = self . get_path ( ) regions = [ ] for selection in seled_fnames : matches = self . _find_in_view ( selection ) for region in matches : filename = self . get_parent ( region , path ) if filename == selection : name_point = self . _get_name_point ( region ) regions . append ( Region ( name_point , name_point ) ) break if regions : return self . _add_sels ( regions ) else : # e.g. when user remove file(s), we just restore sel RegionSet # despite positions may be wrong sometimes return self . _add_sels ( seled_regions ) # fallback: return self . _add_sels ( )