code: def indent(self):
          
          cursor = self.editor.textCursor()
          assert isinstance(cursor, QtGui.QTextCursor)
          if cursor.hasSelection():
              self.indent_selection(cursor)
          else:
              # simply insert indentation at the cursor position
              tab_len = self.editor.tab_length
              cursor.beginEditBlock()
              if self.editor.use_spaces_instead_of_tabs:
                  nb_space_to_add = tab_len - cursor.positionInBlock() % tab_len
                  cursor.insertText(nb_space_to_add * " ")
              else:
                  cursor.insertText('\t')
              cursor.endEditBlock()
docs: Indents text at cursor position.