Skip to content

IDLE: Wrong highlighting when previous line ends with backslash #140334

@TheLizzard

Description

@TheLizzard

Bug report

Bug description:

Code like this

str. \
    format

should be coloured the same way as

str.format

Right now IDLE doesn't respect the slash before the newline and thinks that every new line is a new statement.

Similarly in:

x = match if match else \
                   match

The last match should be coloured in like a variable and not a keyword.

Image

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-IDLEtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions