Skip to content

Conversation

@microbit-robert
Copy link
Collaborator

@microbit-robert microbit-robert commented Sep 15, 2022

Closes #856.
Closes #812.
Closes #800.
Closes #539.

@github-actions
Copy link

github-actions bot commented Sep 15, 2022

Preview build will be at
https://review-python-editor-v3.microbit.org/dnd-fixes/

@microbit-robert
Copy link
Collaborator Author

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.

@microbit-robert
Copy link
Collaborator Author

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.

@microbit-matt-hillsdon
Copy link
Collaborator

Rebased so it deploys properly.

@microbit-matt-hillsdon
Copy link
Collaborator

microbit-matt-hillsdon commented Oct 17, 2022

This works well, though it doesn't really fix #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.

@microbit-matt-hillsdon
Copy link
Collaborator

Superseded by #1037 which avoids this issue and allow the user control over the ambiguity in #812.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants