From 4bc8a4fcb5cbeed57b98ff00eddb8e8845e26a3b Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 4 Mar 2002 10:40:57 +0000 Subject: Fixed bug when switching buffers led to stale line layout cache entries by deallocating the cache when switching buffers. When number of lines decreases, line layout cache entries for extra lines are deleted. --- src/Editor.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Editor.cxx') diff --git a/src/Editor.cxx b/src/Editor.cxx index 64e643b67..fd8a2d719 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -179,7 +179,13 @@ void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) { } if (lengthForLevel > size) { Deallocate(); - } else if (lengthForLevel != length) { + } else { + if (lengthForLevel < length) { + for (int i=lengthForLevel; iLinesTotal() - 1); + llc.Deallocate(); NeedWrapping(); pdoc->AddWatcher(this, 0); -- cgit v1.2.3