Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upIncorrect undo behavior following a code block #826
Comments
|
Oh nice find |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If i type this into bpython:
>>> for i in range(10):... print(i)And then do a rewind/undo after it prints the numbers 0-9, it removes only the 9. Pressing undo again undoes the rest.
I'm pretty sure this is due to the trailing blank lines in the buffer. So in curtsiesfrontend/repl.py,
prompt_undo()sees the last input line as blank (self.history) even though the last output line (self.display_lines) is not blank. So it callstake_back_empty_line().The trailing blank lines are definitely nice, so I think the goal behavior here is to undo the print and take you back to the buffer.
I might be able to fix this with the PR I'm working on right now, but I'm not exactly sure how yet, so I wanted to document it.