Highlights given editor current line.

    :param editor: Document editor.
    :type editor: QWidget
    :return: Method success.
    :rtype: bool

def highlight_current_line(editor):
    """
    Highlights given editor current line.

    :param editor: Document editor.
    :type editor: QWidget
    :return: Method success.
    :rtype: bool
    """

    format = editor.language.theme.get("accelerator.line")
    if not format:
        return False

    extra_selections = editor.extraSelections() or []
    if not editor.isReadOnly():
        selection = QTextEdit.ExtraSelection()
        selection.format.setBackground(format.background())
        selection.format.setProperty(QTextFormat.FullWidthSelection, True)
        selection.cursor = editor.textCursor()
        selection.cursor.clearSelection()
        extra_selections.append(selection)
    editor.setExtraSelections(extra_selections)
    return True