From 2224d2e73e83faba2e24c50798ed73ef62e7e94c Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Thu, 12 Sep 2024 02:56:56 -0400 Subject: [PATCH] Fix history overflowing --- internal/history.go | 1 + 1 file changed, 1 insertion(+) 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:] } }