Closed microbit-robert closed 2 years ago
Preview build will be at https://review-python-editor-v3.microbit.org/dnd-fixes/
Slight issue with "while smooshing". while
is lost if appending one line below existing while block, but returns two lines below existing while block and beyond.
Slight issue with "while smooshing".
while
is lost if appending one line below existing while block, but returns two lines below existing while block and beyond.
There appears to be a bug in the isInWhileTrueTree
function where the tree believes it is in a while statement
when it is not. Most easily observed when add new lines below a while True
loop and then dragging and new while True
example from bottom to top.
Rebased so it deploys properly.
This works well, though it doesn't really fix https://github.com/microbit-foundation/python-editor-v3/issues/812 how I was expecting. That issue refers to using the horizontal position to influence the indent to span to some existing level.
There's an inconsistency in this change in terms of appending to an existing block:
# Imports go at the top
from microbit import *
if accelerometer.was_gesture("shake"):
display.show(Image.MEH)
sleep(1000)
while True:
if accelerometer.was_gesture("shake"):
display.show(Image.MEH)
sleep(1000)
display.show(Image.HAPPY)
Dragging after the first sleep(1000) nests in the if.
Dragging after the second nests in the while.
It feels as if the logic should be the same.
Previously both cases placed outside the if.
Superseded by https://github.com/microbit-foundation/python-editor-v3/pull/1037 which avoids this issue and allow the user control over the ambiguity in https://github.com/microbit-foundation/python-editor-v3/issues/812.
Closes #856. Closes #812. Closes #800. Closes #539.