def indent(self):
cursor = self.editor.textCursor()<EOL>assert isinstance(cursor, QtGui.QTextCursor)<EOL>if cursor.hasSelection():<EOL><INDENT>self.indent_selection(cursor)<EOL><DEDENT>else:<EOL><INDENT>tab_len = self.editor.tab_length<EOL>if cursor.positionInBlock() < self.min_column and not cursor.atBlockEnd():<EOL><INDENT>cursor.movePosition(cursor.Right, cursor.MoveAnchor, self.min_column)<EOL><DEDENT>cursor.beginEditBlock()<EOL>if self.editor.use_spaces_instead_of_tabs:<EOL><INDENT>nb_space_to_add = tab_len - (cursor.positionInBlock() - self.min_column) % tab_len<EOL>cursor.insertText(nb_space_to_add * "<STR_LIT:U+0020>")<EOL><DEDENT>else:<EOL><INDENT>cursor.insertText('<STR_LIT:\t>')<EOL><DEDENT>cursor.endEditBlock()<EOL>self.editor.setTextCursor(cursor)<EOL><DEDENT>
Indents text at cursor position.