Skip to content

Commit d7311af

Browse files
committed
Fix off by one in undo stack size check
1 parent 12197cb commit d7311af

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/_pyrepl/reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ def enter_insert_mode(self) -> None:
901901

902902
self.vi_mode = VI_MODE_INSERT
903903

904-
if len(self.undo_stack) > MAX_VI_UNDO_STACK_SIZE:
904+
if len(self.undo_stack) >= MAX_VI_UNDO_STACK_SIZE:
905905
self.undo_stack.pop(0)
906906

907907
self.undo_stack.append(ViUndoState(

0 commit comments

Comments
 (0)