'Indent current line or selection
force=True: indent even if cursor is not a the beginning of the line'

def indent(self, force=False):

    leading_text = self.get_text('sol', 'cursor')
    if self.has_selected_text():
        self.add_prefix(self.indent_chars)
    elif (force or (not leading_text.strip()) or (self.tab_indents and self.tab_mode)):
        if self.is_python_like():
            if (not self.fix_indent(forward=True)):
                self.add_prefix(self.indent_chars)
        else:
            self.add_prefix(self.indent_chars)
    elif (len(self.indent_chars) > 1):
        length = len(self.indent_chars)
        self.insert_text(('    ' * (length - (len(leading_text) % length))))
    else:
        self.insert_text(self.indent_chars)
