diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-13 17:16:24 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-13 17:16:24 +0100 |
| commit | 5f1d0213e0dadecc8f93d44e36ea3a11a1aa9baa (patch) | |
| tree | 8c01fd9b8f9e446d17adf9c415e0a4d6ef988a18 /CrowIDE/src/Editors/CodeBuffer/CodeBuffer.cs | |
| parent | 99d63b94c2e0e09eae8efb67e720920c130f7346 (diff) | |
limit to html safe color plus several ones, crowIDE wip
Diffstat (limited to 'CrowIDE/src/Editors/CodeBuffer/CodeBuffer.cs')
| -rw-r--r-- | CrowIDE/src/Editors/CodeBuffer/CodeBuffer.cs | 6 |
1 files changed, 4 insertions, 2 deletions
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; |