X Tutup
Skip to content

Commit e46aefa

Browse files
committed
fix to keep rl_history the same after undo. a bit hacky so maybe find a better way one day
1 parent 05b111d commit e46aefa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bpython/repl.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,14 @@ def undo(self, n=1):
666666
if len(self.history) < n:
667667
n = len(self.history)
668668

669+
entries = list(self.rl_history.entries)
670+
669671
self.history = self.history[:-n]
672+
670673
self.reevaluate()
671674

675+
self.rl_history.entries = entries
676+
672677
def reevaluate(self):
673678
"""Clear the buffer, redraw the screen and re-evaluate the history"""
674679

0 commit comments

Comments
 (0)
X Tutup