Fix ArgumentOutOfRangeException in RichText.Concat() #242
https://github.com/icsharpcode/AvalonEdit/pull/242 (tests to be ported seperately.)
This commit is contained in:
Родитель
8df179befd
Коммит
185700c931
|
@ -157,8 +157,8 @@ namespace AvaloniaEdit.Highlighting
|
|||
{
|
||||
Debug.Assert(newOffsets.Length == newColors.Length);
|
||||
Debug.Assert(newOffsets[0] == 0);
|
||||
// remove everything before offset:
|
||||
while (_stateChangeOffsets.Count > 0 && _stateChangeOffsets.Last() <= offset)
|
||||
// remove everything not before offset:
|
||||
while (_stateChangeOffsets.Count > 0 && _stateChangeOffsets.Last() >= offset)
|
||||
{
|
||||
_stateChangeOffsets.RemoveAt(_stateChangeOffsets.Count - 1);
|
||||
_stateChanges.RemoveAt(_stateChanges.Count - 1);
|
||||
|
|
Загрузка…
Ссылка в новой задаче