aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-12-22 20:07:47 +0100
committerbptato <nincsnevem662@gmail.com>2024-12-22 20:07:47 +0100
commitbeed7244d46cc2a0595861d1bab7e83873e4d891 (patch)
treeae183c126326dfbbd1939cc5f1b76cb0bce13216 /src
parentb4749c232c0eb2e2e325aa3497418e6a6804380d (diff)
downloadchawan-beed7244d46cc2a0595861d1bab7e83873e4d891.tar.gz
history: fix entry dropping
next's pointer backwards must be updated too, or it the dropped ref will be erroneously displayed on the history screen.
Diffstat (limited to 'src')
-rw-r--r--src/config/history.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/config/history.nim b/src/config/history.nim
index 879f0b77..8b903dc8 100644
--- a/src/config/history.nim
+++ b/src/config/history.nim
@@ -44,6 +44,8 @@ proc add(hist: History; entry: HistoryEntry) =
hist.last = entry
inc hist.len
if hist.len > hist.maxLen:
+ if hist.first.next != nil:
+ hist.first.next.prev = nil
hist.first = hist.first.next
if hist.first == nil:
hist.last = nil