def unindent(self):
_logger().debug('<STR_LIT>')<EOL>cursor = self.editor.textCursor()<EOL>_logger().debug('<STR_LIT>', cursor.hasSelection())<EOL>if cursor.hasSelection():<EOL><INDENT>cursor.beginEditBlock()<EOL>self.unindent_selection(cursor)<EOL>cursor.endEditBlock()<EOL>self.editor.setTextCursor(cursor)<EOL><DEDENT>else:<EOL><INDENT>tab_len = self.editor.tab_length<EOL>indentation = cursor.positionInBlock()<EOL>indentation -= self.min_column<EOL>if indentation == <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>max_spaces = indentation % tab_len<EOL>if max_spaces == <NUM_LIT:0>:<EOL><INDENT>max_spaces = tab_len<EOL><DEDENT>spaces = self.count_deletable_spaces(cursor, max_spaces)<EOL>_logger().info('<STR_LIT>' % spaces)<EOL>cursor.beginEditBlock()<EOL>for _ in range(spaces):<EOL><INDENT>cursor.deletePreviousChar()<EOL><DEDENT>cursor.endEditBlock()<EOL>self.editor.setTextCursor(cursor)<EOL>_logger().debug(cursor.block().text())<EOL><DEDENT>
Un-indents text at cursor position.