From e1ac1a0c8bddbea787fa936ce06c3c8dceb4d154 Mon Sep 17 00:00:00 2001 From: gdkhd812 Date: Sat, 14 Oct 2017 22:45:46 +0900 Subject: [PATCH] =?utf8?q?=E7=9F=A9=E5=BD=A2=E9=81=B8=E6=8A=9E=E6=99=82?= =?utf8?q?=E3=81=AB=E8=90=BD=E3=81=A1=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C?= =?utf8?q?=E3=81=82=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Core/LineToIndex.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Core/LineToIndex.cs b/Core/LineToIndex.cs index 71dce51..ef32a08 100644 --- a/Core/LineToIndex.cs +++ b/Core/LineToIndex.cs @@ -334,8 +334,12 @@ namespace FooEditEngine /// public void ClearLayoutCache(int index,int length) { + if (index >= this.Document.Length) + return; int startRow = this.GetLineNumberFromIndex(index); int lastIndex = Math.Min(index + length - 1, this.Document.Length - 1); + if (lastIndex < 0) + lastIndex = 0; int endRow = this.GetLineNumberFromIndex(lastIndex); for (int i = startRow; i <= endRow; i++) this.Lines[i].Dispose(); -- 2.11.0