microbit-foundation / python-editor-v3

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

Incorrect highlighting dragging when there's no trailing line #823

Closed microbit-matt-hillsdon closed 2 years ago

microbit-matt-hillsdon commented 2 years ago

Kapture 2022-07-18 at 11 52 24

microbit-matt-hillsdon commented 2 years ago

This is still the case after recent drag and drop changes.

microbit-matt-hillsdon commented 2 years ago

There's a related issue where we don't get the indent right when dragging into an empty block at the end of the document. Similarly to this, we don't account for the fact the insertion may begin at the end of the preceding line. Different but similar fix.

microbit-matt-hillsdon commented 2 years ago

There's a related issue where we don't get the indent right when dragging into an empty block at the end of the document. Similarly to this, we don't account for the fact the insertion may begin at the end of the preceding line. Different but similar fix.

This is now fixed on the PR captured by the edits.test.ts "uses correct preceding line for indent at end of document" test.