def clear_selection(self):
        """Clears text cursor selection."""
        text_cursor = self._editor.textCursor()
        text_cursor.clearSelection()
        self._editor.setTextCursor(text_cursor)