'Simply preserve the indentation-level of the previous line.'

def simple_indentation(self, forward=True, **kwargs):

    cursor = self.textCursor()
    block_nb = cursor.blockNumber()
    prev_block = self.document().findBlockByLineNumber((block_nb - 1))
    prevline = to_text_string(prev_block.text())
    indentation = re.match('\\s*', prevline).group()
    if (not forward):
        indentation = indentation[len(self.indent_chars):]
    cursor.insertText(indentation)
    return False
