diff --git a/internal/history.go b/internal/history.go index 358a6ab..b3ef0b0 100644 --- a/internal/history.go +++ b/internal/history.go @@ -49,6 +49,7 @@ func (this *History[T]) Push (item T) { } if len(this.stack) > this.max { + this.topIndex -- this.stack = this.stack[1:] } }