(self, event=None)
return "break"
Convert leading spaces to tabs for each line in selected region.
Convert leading spaces to tabs for each line in selected region.
Convert leading spaces to tabs for each line in selected region .
def tabify_region_event(self, event=None):
        "Convert leading spaces to tabs for each line in selected region."
        head, tail, chars, lines = self.get_region()
        tabwidth = self._asktabwidth()
        if tabwidth is None:
            return
        for pos in range(len(lines)):
            line = lines[pos]
            if line:
                raw, effective = get_line_indent(line, tabwidth)
                ntabs, nspaces = divmod(effective, tabwidth)
                lines[pos] = '\t' * ntabs + ' ' * nspaces + line[raw:]
        self.set_region(head, tail, chars, lines)
        return "break"
def tabify_region_event ( self , event = None ) : head , tail , chars , lines = self . get_region ( ) tabwidth = self . _asktabwidth ( ) if tabwidth is None : return for pos in range ( len ( lines ) ) : line = lines [ pos ] if line : raw , effective = get_line_indent ( line , tabwidth ) ntabs , nspaces = divmod ( effective , tabwidth ) lines [ pos ] = '\t' * ntabs + ' ' * nspaces + line [ raw : ] self . set_region ( head , tail , chars , lines ) return "break"