Skip to content

Python: Cmd+Enter does not send portion of multi-line statement above cursor to console #1260

@jmcphers

Description

@jmcphers

To reproduce, create a Python file with the following contents:

sixty = 20 + \
    20 + \
    20

Place the cursor on the middle line and press Cmd Enter.

Only the middle line is sent to the Console. However, because this is one statement spread over 3 lines, the whole statement should be sent to the Console, not just the current line.

Note

This happens because the Python statement range finder does not ever look above the cursor point (only beneath it). https://github.com/posit-dev/positron-python/blob/main/src/client/positron/statementRange.ts

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions