From 5f1d0213e0dadecc8f93d44e36ea3a11a1aa9baa Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Tue, 13 Mar 2018 17:16:24 +0100 Subject: limit to html safe color plus several ones, crowIDE wip --- CrowIDE/src/Editors/CodeBuffer/CodeBuffer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'CrowIDE/src/Editors/CodeBuffer/CodeBuffer.cs') diff --git a/CrowIDE/src/Editors/CodeBuffer/CodeBuffer.cs b/CrowIDE/src/Editors/CodeBuffer/CodeBuffer.cs index 13c422a6..7d5efec9 100644 --- a/CrowIDE/src/Editors/CodeBuffer/CodeBuffer.cs +++ b/CrowIDE/src/Editors/CodeBuffer/CodeBuffer.cs @@ -63,7 +63,7 @@ namespace Crow.Coding public CodeLine this[int i] { - get { return lines[i]; } + get { return i < LineCount ? lines[i] : null; } set { if (lines [i] == value) return; @@ -392,7 +392,9 @@ namespace Crow.Coding editMutex.EnterReadLock (); - if (value >= lines.Count) + if (LineCount == 0) + _currentLine = 0; + else if (value >= lines.Count) _currentLine = lines.Count-1; else if (value < 0) _currentLine = 0; -- cgit v1.3.1-4-g156e