microbit-foundation / python-editor-v3

Micro:bit Educational Foundation Python Editor V3
https://python.microbit.org
MIT License
57 stars 36 forks source link

Drag and drop indent matching can be confused by empty blank lines #800

Closed microbit-matt-hillsdon closed 2 years ago

microbit-matt-hillsdon commented 2 years ago

It's common for blank lines not to be indented along with the rest of the code. In any case you can't tell the difference easily. We don't special case blank lines so we can end up matching their indent level when that isn't appropriate.

E.g.

while True:

    display.scroll("Drag above me note no spaces on previous line")
microbit-matt-hillsdon commented 2 years ago

Confirmed https://github.com/microbit-foundation/python-editor-v3/pull/1037 addresses this scenario. Blank or whitespace-only lines are now ignored.