microbit-foundation / python-editor-v3

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

Matching indent to blank lines can be confusing #856

Closed microbit-matt-hillsdon closed 2 years ago

microbit-matt-hillsdon commented 2 years ago

It's quite easy to end up with a whitespace indent on a blank line from a delete like this:

Screenshot2022_08_01_151321

(arguably the location of our indent lines makes this misleading)

Then if you drag content to that line we match the three spaces on the blank line not the four spaces on the line above.

That results in a pile of confusing errors:

image

Probably originally seen by Lorna but hard to be sure this repro matches.

microbit-matt-hillsdon commented 2 years ago

The fix on #963 results in this end result:

image

So something has gone awry.

microbit-matt-hillsdon commented 2 years ago

Confirmed that https://github.com/microbit-foundation/python-editor-v3/pull/1037 addresses this.