def serial_line_endings_to_sublime(text, line_endings):
    """
    Converts the serial line endings to sublime text line endings

    :param text: the text to convert line endings for
    :param line_endings: the serial's line endings setting: "CR", "LF", or "CRLF"
    :return: the new text
    """
    if line_endings == "CR":
        return text.replace("\r", "\n")
    if line_endings == "CRLF":
        return text.replace("\r", "")
    return text